0

Is there any general formula for fibonacci(A+B)?

I have tried to derive it , and got following results. $$\begin{align} &fib(a+1)=1*fib(a)+fib(a-1)\\ &fib(a+2)=2*fib(a)+fib(a-1)\\ &fib(a+3)=fib(a+2)+fib(a+1)=\!\text{(sum of above two formulas)}\!=3fib(a)+2fib(a-1)\\ &fib(a+4)=5fib(a)+3fib(a-1)\\ &\qquad\vdots\\ &fib(a+b)=fib(b+1)*fib(a)+fib(b)*fib(a-1) \end{align}$$

Is this formula correct or there is something wrong..?

AugSB
  • 5,007
grogu
  • 11
  • 3
    This is correct! You may want to peruse Wikipedia's Fibonacci page, because they have this and more: https://en.wikipedia.org/wiki/Fibonacci_number – Matt Groff Apr 06 '16 at 15:58
  • 1
    this appears to be related to an active competition, https://www.codechef.com/APRIL16/problems/FIBQ . I note that one of your prior questions was locked because it, too, was from a codechef competition (http://math.stackexchange.com/questions/1686737/how-many-strings-possible-with-atmost-2-distance-away). – lulu Apr 06 '16 at 16:09
  • @lulu .! I am learning about properties of fibonacci numbers. Main motive of long contest is learning , you can learn lot of things . I didnot ask direct answer for that question . I just wanted to know that whatever i am doing is correct or not ...! – grogu Apr 06 '16 at 16:55
  • 2
    Your prior question was exactly equivalent to a (then active) codechef competition problem. In neither case did you cite the contest as the source for your question. Most people here would, I think, want to hold off on answering until the competition was done. At a minimum, you should link to the ongoing contest so people can decide for themselves if they want to help. – lulu Apr 06 '16 at 17:04

2 Answers2

2

The $n$-th Fibonacci number is given in closed form by

$$F_n=\frac{1}{\sqrt{5}}\left(\frac{1+\sqrt{5}}{2}\right)^n- \frac{1}{\sqrt{5}}\left(\frac{1-\sqrt{5}}{2}\right)^n $$

You can see this here

So, the following can be proved by substituting the closed form formula in the R.H.S $$F_{a+b} = F_aF_{b-1} + F_{a+1}F_b $$ Let $x = \frac{1+\sqrt{5}}{2}$ and $y = \frac{1-\sqrt{5}}{2}$

Then, $xy = \frac{(1+\sqrt{5})(1-\sqrt{5})}{4} = -1 \implies xy + 1 = 0$

$F_aF_{b-1} + F_{a+1}F_b$ (in terms of $x$ and $y$) is: $$ \frac{(x^a-y^a)(x^{b-1}-y^{b-1})}{\sqrt5 \cdot \sqrt 5} + \frac{(x^{a+1}-y^{a+1})(x^b-y^b)}{\sqrt5 \cdot \sqrt 5}$$ $$= \frac{x^{a+b-1} - x^ay^{b-1} - x^{b-1}y^a + y^{a+b-1} + x^{a+b+1} - x^{a+1}y^b - x^by^{a+1} + y^{a+b+1}}{5}$$ $$= \frac{x^{a+b}(x+x^{-1}) + y^{a+b}(y+y^{-1}) - x^ay^b(x+y^{-1}) - x^by^a(x^{-1}+y)}{5}$$ $$= \frac{x^{a+b}(x+x^{-1}) + y^{a+b}(y+y^{-1}) - x^ay^{b-1}(xy+1) - x^{b-1}y^a(xy+1)}{5}$$ $$= \frac{x^{a+b}(x+x^{-1}) + y^{a+b}(y+y^{-1})}{5}$$ $$= \frac{x^{a+b} - y^{a+b}}{\sqrt 5}$$ $$=F_{a+b}$$ because $$x + x^{-1} = \sqrt 5$$ $$y + y^{-1} = -\sqrt 5$$

Simran
  • 96
1

This follows from the matrix formulation, which is well worth knowing and easily proved: $$ \begin{pmatrix}1&1\\1&0\end{pmatrix}^n= \begin{pmatrix}F_{n+1}&F_n\\F_n&F_{n-1}\end{pmatrix} $$

Let $ A=\begin{pmatrix}1&1\\1&0\end{pmatrix} $. Then $A^{a+b}=A^{a}A^b$. Just read the corresponding entries.

lhf
  • 216,483