Try to make a formula for it, like

For instance you have 100 dollar

after one year you will have; 100*1.12 = 112

after two years you will have; 112*1.12 = 100*1.12*1.12= 100* (1.12)^2=...

afterxyears you will have; 100*(1.12)^x=....

Now you have to end with 200 dollars in this case. Can you finish the formula?