A = P(1 + r)^n
where A is the amount after n years, P = principal( initial amount), r = annual rate as a decimal fraction and n = number of years
If interest is accumulated say monthly then it would be
A = P(1 + r/12)^12n
For quarterly replace the 12 by 4