How to calculate after how many years does interest payment equal principal amount? I am trying to make a formula to show that for an interest rate of $X \%$, it takes $Y$ years for the annual compound interest to be larger than the original principal amount.
I have come up with the following formula but dont think it is correct,
$Z\text{principal}\cdot\left(1+\dfrac{X}{100}\right)^Y=$ some amount that interest of it is equal to $Z= 100\dfrac{Z}{X}$, so
$$
\begin{split}
\left(\frac{X+100}{100}\right)^Y&=\frac{100}{X}\\
\ln\left(\frac{X+100}{100}\right)^Y&=\ln\frac{100}{X}\\
Y\cdot\ln\left(\frac{X+100}{100}\right)& =\ln\dfrac{100}{X}\\
Y &=\frac{\ln\dfrac{100}{X}}{\ln\left(\frac{X+100}{100}\right)}
\end{split}
$$
Sorry I dont know how to use latex to make the formulae look nice.
Any help will be appreciated
 A: The mistake you made was to write that the amount after $y$ years is $100Z/X$. This expressions is rather arbitrary and it does not hold for all combinations of numbers, for the result that you want.
I'll clear up the notation and solve the equation myself. I prefer to use $n$ for the number of years, and I prefer to use $p$ for the percentage factor $p = 1+\frac{X}{100}$. This way, when the interest is, for example $9~\%$, we have $p=1.09$. I think this notation makes the equations much easier.
So in the beginning you have amount (principal) $Z$ which has an interest rate $p$. After $n$ years, the amount is
$$
p^n Z
$$
And after $n+1$ years it's
$$
p^{n+1}Z
$$
You wanted their difference to be larger than the original principal $Z$, or
$$
p^{n+1}Z - p^n Z > Z
$$
It's easy to see that we can divide both sides by $Z$ (we'll assume $Z>0$) to get
$$
p^{n+1} - p^n  > 1 \qquad \Rightarrow \qquad p^n (p-1) > 1
$$
From this, it's rather easy to solve for $n$:
$$
p^n > \frac{1}{p-1} \qquad \Rightarrow \qquad n \cdot \ln p > -\ln (p-1)
$$
The condition then becomes
$$
n > -\frac{\ln (p-1)}{\ln p}
$$
As a numerical example, if we use the previous example of $9~\%$ interest rate, we get
$ n >27.94$ or 28 years. From this example, we see that actually, we should take the ceiling function of this, because the interest is only given annually. So the most accurate answer would be
$$
n \geq \lceil -\frac{\ln (p-1)}{\ln p} \rceil
$$
