General query about Lucas Sequence

59 Views Asked by At

Lucas Sequence with 1 and 3 as initial values

Why is it convention to have recursive sequences like the Fibonacci and Lucas numbers start at 0? For example Fibonacci Sequence has $F_{0} = 0$, $F_{1} = 1$ and $F_{2} = 1$, whilst Lucas's sequence has $L_{0} = 2$, $L_{1} = 1$ and $L_{2} = 3$.

For the Fibonacci Sequence, having $F_{0} = 0$ does not really have any impact, but for the Lucas Sequence, the first prime number, "$2$", is added there when, in my opinion, it is not really required when the Lucas Sequence can be defined as $L_{1} = 1$ and $L_{2} = 3$, and $L_{n} = L_{n-1} + L_{n-2}$ for $n < 2$ in it's recursive rule.

I ask because I am writing a javascript program which generates the Lucas prime numbers and I was pondering which is better: to start the list with "$2$" or "$3$"?

2

There are 2 best solutions below

1
On

Since $F(n)=F(n-1)+F(n-2)$ we can rearrange this to give $F(n-2) =F(n)-F(n-1)$. So we can use this to go backwards as well as forwards:

$F(2)=1\\F(1)=1\\F(0)=1-1=0\\F(-1)=1-0=1\\F(-2)=0-1=-1\\F(-3)=1-(-1)=2\\F(-4)=-1-2=-3$

etc. So it does not matter where we start - the sequence extends in both directions. The same argument applies to the Lucas numbers, where we have:

$L(2)=3\\L(1)=1\\L(0)=3-1=2\\L(-1)=1-2=-1\\L(-2)=2-(-1)=3\\L(-3)=-1-3=-4\\F(-4)=3-(-4)=7$

etc.

0
On

You can play with $$F_n=F_{n-1}+F_{n-2}\qquad \text{where} \qquad F_0=a \quad\text{and}\quad F_1=b$$

$$F_n=\frac{a}{2} \left(3 F_n-L_n\right)+\frac{b}{2} \left(L_n-F_n\right)$$