# Reimbursement formula

Let’s assume that you work at an awesome company as a contractor.
They allow you to purchase equipment, and will reimburse the money you spent.

However, as a freelancer, you have to pay taxes. Let’s assume taxes are at 10% for any payment you receive on your account.

To further increase the greatness of the company, they say they will pay the taxes for you as long as you do the proper calculation.

So, as an example, let’s say you spend like $100 on computer equipment and ask for$100 reimbursement.
You will receive $100 on your bank account and have to pay 10% of that in taxes, so that’s$10, so you end up with $90. You might also try to ask for$110 from the company, but 10% of that is $11 so you are left with$99. If you ask them to send you $11 for the taxes you paid, you will again have to pay 10% of$11 ($1.1) in taxes, and so on. So the question is, how much money should the company reimburse you once, so that you get an amount close to the one you spent which includes taxes? The answer is, if N is the money spent, you need to ask for reimbursement of $N + \lceil \frac{N}{9} \rceil$ money. As an example: I spend:$100
They send: $N + \lceil \frac{N}{9} \rceil$, or $112 I pay tax: 10% *$112 = \$11.2

Now, it holds that $\112 = Send \geq Spend + Tax = \111.2$

To derive that formula, we need to think in terms of recursion. Consider that multiple transactions are made, and for each transaction, you need to pay 10% in taxes of the transaction value.

That makes something like: $S = N + N/10 + N/100 + ... = N(1 + 1/10 + 1/100 + ...)$.
To calculate the $1 + 1/10 + 1/100 + ...$ part, we can let $n = 1.1111...$. So, $10n = 11.1111...$ and $10n - n = 9n = 10$ and we get that $n = 10/9$. We rewrite that as $1 + 1/9$ so that we can use ceil on the fractional part to get an integer.