1

We know that Fibonacci Numbers start with 0 and next element is 1 and F(n)=F(n-1)+F(n-2) to find nth term where n>=2 and F(0)=0 F(1)=1 .

But what if we suppose the first 2 terms of fibonacci series be a and b then what will be its nth term?

Like if a=1 b=2 then if we want to find 4th term then it will be 5.

user3001932
  • 1,056
  • 1
    You picked two adjacent terms of the fibonacci sequence , so you will generate the entire fibonacci sequence. If you don't pick two adjacent terms then there's probably a more complicated explanation(I have no clue what that explanation may be) :) – neofoxmulder Feb 15 '14 at 15:55

3 Answers3

2

You also have $F_{-1}=1$, so that $(F_{-1},F_0)$ and $(F_0,F_1)$ form the canonical basis for the space of pairs of first two elements. The sequence starting in $(a,b)$ is thus a linear combination of both shifted sequences, $G_n=aF_{n-1}+bF_n$.

Lutz Lehmann
  • 126,666
1

$$F(n) = F(n - 1) + F(n - 2)$$ $$F(n - 1) = F(n - 1)$$


$$ \begin{bmatrix} F(n) \\ F(n - 1) \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix} \begin{bmatrix} F(n - 1) \\ F(n - 2)\end{bmatrix}$$

$$ \begin{bmatrix} F(n + 1) \\ F(n) \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ 1 & 0 \end{bmatrix}^n \begin{bmatrix} b \\ a \end{bmatrix}$$

Now if you want a more closed form than that you can do eigen value decomp on the matrix: $$ \begin{bmatrix} F(n + 1) \\ F(n) \end{bmatrix} = \begin{bmatrix} 1 & 1 \\ -\frac 2 {\sqrt{5} - 1} & \frac 2 {\sqrt{5} + 1} \end{bmatrix} \begin{bmatrix} -\frac{\sqrt{5} - 1} 2 & 0 \\ 0 & \frac{\sqrt{5} + 1} 2 \end{bmatrix} ^n \begin{bmatrix} 1 & 1 \\ -\frac 2 {\sqrt{5} - 1} & \frac 2 {\sqrt{5} + 1} \end{bmatrix}^{-1} $$

$$F(n) = \frac {b} {\sqrt{5}} \left(\phi^n - \omega^n\right) + \frac {a} {\sqrt{5}} \left(\phi^{n-1} - \omega^{n - 1}\right)$$

using: $$\phi = \frac{1 + \sqrt 5} 2$$ $$\omega = \frac{1 - \sqrt 5 } 2$$

DanielV
  • 23,556
0

There is a closed form expression $$\frac{1}{2} \left((2 b-a) F_n+a L_n\right)$$ where appears Fibonacci and Lucas numbers. This last numbers satisfy the same relation

$$L(n) = L(n - 1) + L(n - 2)$$ with $L(1)=1$ and $L(2)=3$.

For your example, the fourth term should be $(a+2b)$