Your Turn to Try:

The Fibonacci sequence is defined by
   
    (Subscript[F, 1 ])= (Subscript[F, 2]) = 1
    			and
    (Subscript[F, m ])= (Subscript[F, m - 1])  +  (Subscript[F, m-2 ])
    
1. Write a function that calculates (Subscript[F, m ])

2. Look up Mathematica's Table functions; create a list of Logs of the first 10, 20, and 30 Fibonacci numbers.

3. Look up Mathematica's ListPlot function; Plot Log[(Subscript[F, m ])] versus m.

fib[1]  =  fib[2]  =  1;
fib[n_Integer?Positive]  :=  fib[n - 1]  +  fib[n - 2]

logfibs  = 
Table[
Table[
            Log[fib[i]], {i, 1, size}], 
{size, 10, 30, 
            10}];
logfibs

Display trick

Table[TableForm[N[logfibs[[i]]]], {i, 3}]

ListPlot[logfibs[[3]]]

Your Turn to Try:

Generalize the Fibonacci sequence F[2] to F[n] where each term sums up to
  
  (Subscript[F, m≤0 ])[
        n] = 0 
  (Subscript[F, 1 ])[n] = 1
  (Subscript[F, 2 ])[n] = 1
  (Subscript[F, 3 ])[n] = (Subscript[F, 2 ])+ (Subscript[F, 1 ])
  (Subscript[F, 4 ])[n]= (Subscript[F, 3   ])+ ⋯ + (Subscript[F, 4-n ])
  ⋮
  (Subscript[F, m ])[n]= (Subscript[F, m-1   ])  +  ⋯  +  (Subscript[F, m-n ])
   
    
1. Write a function that calculates (Subscript[F, m ])[n]

2. Look up ListPlot3D; Plot Log[(Subscript[F, m ])[n]] versus n and m

Clear[fib];

fib[m_Integer?NonPositive,  
          n_Integer?NonNegative]  :=  fib[m, n]  =  
          0;

fib[1,  n_Integer?NonNegative]  :=  fib[1, n]  =  
          1;

fib[2,  n_Integer?NonNegative]  :=  fib[2, n]  =  
          1;

fib[m_Integer,  n_Integer?NonNegative]  :=   fib[m, n]  =  
        Sum[fib[m - i, n], {i, 1, n}]

For example

Table[Log[fib[i, 4]], {i, 1, 12}]

ListPlot3D[Table[Log[fib[i, j]], {i, 50}, {j, 50}]]

Your Turn:
    
    A famous---and not very efficient---way to calculate the value of π is with the infinite product:
 π= (2/((∏_(i = 1)^∞) (Subscript[R, i])))   
    
    where
   
    (Subscript[R, 1= ])(1/2)(Sqrt[2 ])
    (Subscript[R, 2= ])(1/2)(Sqrt[2 + (Sqrt[2])])
    (Subscript[R, 3 = ])(1/2)(Sqrt[2 + (Sqrt[2 + (Sqrt[2])])])
    ⋮
    Use this to calculate π and visualize the convergence

pterm[1]  =  Sqrt[2];
pterm[i_Integer?Positive]  :=  pterm[i]  =  
        Sqrt[2  +  pterm[i - 1]]

For example

Table[pterm[i], {i, 1, 10}] // TableForm

rterm[i_]  :=  pterm[i]/2

PiProd[1]  =  rterm[1];
PiProd[n_Integer?Positive]  :=  
      rterm[n] PiProd[n - 1]
PiApprox[
        n_Integer?Positive]  := ((2 )/PiProd)[n]

PiApprox[4]

PiApprox[4] // N

ListPlot[
      Table[
Log[
Abs[
N[PiApprox[i]  -  Pi, 
              100]
]
], 
{i, 1, 100}]]

We could play with the precision limits, but the result is fairly clear.