Pell Numbers

First we will define a Module that generates recursive sequences.

generateSequences[n_, val0_, val1_]:=Module[{seq={val0, val1}, a=val0, b=val1,next, m=2},
If[n ≤ 1, Return[seq]];
Do[
next=m*b+a;            (* compute the next value *)
seq=Append[seq,next];     (* append to the sequence *)
a=b;     (* shift *)
b=next;      (* shift *)
,{i,2,n}];
seq                           (* return the sequence *)
]

For example, we can generate the first ten terms of the Pell sequence:

generateSequences[15,0,1]

generateSequences[5,0,1]

Or we can generate the first ten terms of the Pell-Lucas sequence:

generateSequences[15,2,2]

A cool Pell identity

Store a long list of Pell numbers:

pellSeq=generateSequences[1000,0,1];

The first Pell number is usually denoted (Subscript[P, 0]), so let’s adjust our indexing:

P[n_]:=pellSeq[[n+1]]

{P[0],P[1],P[2]}

Consider:

{
P /@ Range[0,18,3],  (* every third Pell number *)
(P /@ Range[0,6])^3,  (* cube of every Pell number *)
P /@ Range[0,6]  (* just the Pell numbers *)
} // Transpose // TableForm

Suppose we think there is a pattern (Subscript[P, 3n])=((a((Subscript[P, n])))^3)+b (Subscript[P, n]). How can we find the coefficients a and b?

Start with even values of n, and set up two equations to solve:

eq1 = P[3*2]==a * P[2]^3 + b * P[2]      (* n=2 case *)
eq2 = P[3*4]==a * P[4]^3 + b * P[4]      (* n=4 case *)

sol=Solve[{eq1,eq2}, {a,b}]

We find the coefficients 8 and 3. Now, let’s confirm the identity (Subscript[P, 3n])=8((((Subscript[P, n])))^3)+3 (Subscript[P, n]) for a large number of (even) values n.

lhs=Table[P[3n],{n,0,100,2}];  (* P[3n] for even n from 0 to 1000 *)
rhs= Table[a *P[n]^3 + b*P[n], {n,0,100,2}] /. sol[[1]];

lhs==rhs

Your turn:

Modify the previous code to account for odd values of n. (Subscript[P, 3n])=8((((Subscript[P, n])))^3)+(((-1))^n)3 (Subscript[P, n])

Can you find a similar identity for every fifth Pell number? Maybe something like (Subscript[P, 5n])=((a((Subscript[P, n])))^5)+b ((((Subscript[P, n])))^3)+c (Subscript[P, n])