Compound interest

When a deposit is made for several years and rates are included to the capital, the rate is calculated with compound interest: where
C = capital
C(n) = increased capital
n= number of interest time, e.g. years
q= rate factor

Example 1.

A person deposits 2100€ for an account for 6 years. Interest rate is 2.1% p.a. How much money is in the account at the end, if no money is withdrawn during the deposit time?
C = 2100€
n= 6
i = 2.1% p.a.
q= =1.021

Example 2.

If 1000 euros is invested at an annual interest rate of 6 %, compounded semiannually, how long time will it take to have 2000 euros at that account? The interest rate in given as an annual interest rate but compounded semiannually. So, the interest is paid twice a year to the amount actually being at the account. The table below shows the actual money after every payment:   where n = 2t. Now, we have to only solve the equation   It takes almost 12 years to have 2000 euros at that account without any extra payments.