find the nth fibonacci number where each number of is sum of last 3 numbers.

231 Views Asked by At

Using differential equations , I have seen some sites which solve the fibonacci number problem and give us a formula to find the nth fibonacci number.

Similarly I want to find the nth fibonacci number where each number is equal to "LAST THREE" numbers.

Example :

0 1 1 2 4 7 13 .....

How to get the exact formula to find the Nth fibonacci number by removing the recursion from it ?

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

After solving the differential equations :

F(n) = Expression of constants which only depends on "n" .

What is the formula for F(n) ?


Also is it possible to get a formula to find the Nth fibonacci number where each number is equal to the sum of previous "M" numbers ?

F(n,m) = ???

Note : I am not a math student :/

1

There are 1 best solutions below

0
On

The solutions of these generalized Fibonacci problems rest on the resolution of the characteristic equation

$$r^m=r^{m-1}+r^{m-2}+\cdots r+1.$$ which can also be written $$r^{m+1}-2r^{m}+1=0$$ or $$1-2s+s^{m+1}=0$$ (where the solution $r=1$ must be discarded, and $s:=r^{-1}$). This equation has real as well as complex roots. Hence the solution of the recurrence is a linear combination of terms $$(a\cos(n\omega)+b\sin(n\omega))e^{n\tau}$$ where the constants $a,b$ are determined from the initial terms of the sequence (which you forgot to specify) and $\tau,\omega$ are the real and imaginary parts of the roots.

Note that one of the roots clearly dominates the others in modulus, and tends to $2$ with increasing $m$. Hence for large $m$ and large $n$, the solution is close to

$$c2^n.$$

This is justified by

$$2^{m}\approx 2^{m-1}+2^{m-2}+\cdots 2+1.$$

enter image description here