Fibonacci Identities

Module to compute (Subscript[F, n]), the nth Fibonacci number:

computeFib[n_]:=Module[{acc0=0,acc1=1,next},
Do[
next=acc0+acc1;  (* compute the next value *)
acc0=acc1;               (* shift down *)
acc1=next,
{k,1,n}
];
acc0         (* return value *)
]

Try it out:

computeFib /@ Range[20]

Note that this version of computeFib also computes (Subscript[F, 0]) correctly:

computeFib[0]

Investigation

Compute (Subscript[F, n]^2)-(Subscript[F, n+1])(Subscript[F, n-1]) for various values of n. What do you observe? What do you wonder?

Make a big list of Fibonacci numbers:

M=1000;
fibs=computeFib/@Range[1,M+1];

Assemble three lists:

fibsSquared=fibs[[2;;M]]^2;

fibsA=fibs[[3;;M+1]];

fibsB=fibs[[1;;M-1]];

Now compute:

result=fibsSquared-fibsA*fibsB;

Make a comparison list:

minusplus=Table[(-1)^(n+1),{n,2,M}];

Compare the lists:

result==minusplus