Series of real numbers

Off[General::spell1];

Clear[b,h]

Money matters

Suppose that at the age of 25, with momentary thrift, you deposit $100 at an interest rate of 10% per year.  
How much will there be in the account when you retire at the age of 65?	
Suppose that from the age of 25, with iron discipline, you deposit $100 each year in an account that offers an interest rate of 10% per year.  
How much will there be in the account when you retire at the age of 65?	
In this notebook we see how to answer these and related questions

The main Mathematica  functions used are Table and ListPlot.

?Table

?ListPlot

Compound interest

Clear[f]

A sequence of real numbers is a function  f:ℕ->ℝ.  
In Mathematica  it is easy to list, say, the first 10 terms of f :

Table[f[n],{n,0,9}]

Table[f[n],{n,0,9}]//ColumnForm

If you invest $100 at an interest rate of 10% compounded annually the balance in dollars will be 100 after 0 years, 110 after 1 year, 121 after 2 years, and, quite generally, 100×(1.1^n) after n years.  
Let us define the sequence f  of successive balances:

f[n_] := 100*1.1^n

f[0]

f[1]

myDoughGrowing=Table[f[n],{n,0,40}]

After 40 years your investment of $100 has grown substantially. 
The following picture should give you great pleasure:

ListPlot[myDoughGrowing]

Geometric progressions

While the function f was adequate for solving a particular problem, it would be nice to be able handle a variety of initial deposits and interest rates with a single definition. 
This we now do.

A geometric progression  or GP  is a sequence like
	(3, 6, 12, 24,… ) 
in which each term is a fixed multiple of its predecessor.  
The general form is
	(a, a r, a (r^2), a (r^3),… ) ;
a is called the initial term  and r the ratio of the GP.		
It is quite easy to define a function which calculates the n-th term of the GP with given initial term a and ratio r :

GP[a_,r_][n_]:= a*r^n

For example:

GP[b,h][7]

GP[b,h][0]

Table[GP[b,h][n],{n,0,9}]

For a deposit of $100 at an interest rate of 10% per year, the appropriate geometric progression is GP[100,1.10]; it is the same sequence as the f that we defined above. 
Indeed:

GP[100,1.10][0]

GP[100,1.10][1]

GP[100,1.10][2]

GP[100,1.10][40]

Compounded annually your initial deposit of $100 has grown by a factor of more than 45.

Sums of GPs

In our second scenario you deposit $100 each year at an interest rate of 10% per year.  
The sequence of balances is now	
	{ 100,100+110,100+110+121,… } 
We see that after n years the balance is the sum of the first n terms of the GP  { 100,110,121,… } .  

For a general GP  { a,a r,a (r^( 2)),a (r^( 3)),… } the appropriate sum is
	(a+a r+a (r^( 2))+a (r^( 3))+…+a (r^( n-1))=a (1+r+(r^( 2))+(r^( 3))+…+(r^( n-1))).
Using the fact that
	(1+r+(r^( 2))+(r^( 3))+…+(r^( n-1)))(1-r)=1-(r^( n))
we make the following definition:

sumGP[a_,r_][n_]:= a*(1-r^n)/(1-r)

Your thrift is handsomely rewarded:

thriftRewarded = Table[
	sumGP[100,1.1][n]
	,{n,1,40}]

ListPlot[thriftRewarded]

sumGP[100,$$$][$$$]

32 years

amountLeft[0]=632408-60000;
amountLeft[n_]:=1.1*amountLeft[n-1]-60000

Table[amountLeft[n],{n,0,32}]

amtLeft[a_,r_,w_][n_]:=a*r^n-w(1-r^(n+1))/(1-r)

myDoughGoing=Table[amtLeft[632408,1.1,60000][n],{n,0,32}]

ListPlot[myDoughGoing]

Less than 8 years.  Indeed using the function amtLeft defined above, we see that

Table[amtLeft[632408,1.1,100000][n],{n,0,8}]