I am currently solving a recursion problem.
If I have this function f(n+2)=f(n+1)+f(n)+(n+1) where f(0)=0,f(1)=1
It appears to me that this function can be reduced in form of fibonacci function.Can anyone tell me how this can be expressed as Fibonacci function.
The answer is f(n)=2(fib(n+2)-1)-n.
Can anyone explain how?
The Original Question
The equation that needs to be satisfied is $$ \left(S^2-S-1\right)f(n)=n+1 $$ where $Sf(n)=f(n+1)$ is the shift operator. $$ \begin{align} \left(S^2-S-1\right)(\color{#C00}{-2}\color{#090}{-n}\color{#00F}{+F_{n+3}}) &=\color{#C00}{2}\color{#090}{+n-1}\color{#00F}{+0}\\ &=n+1 \end{align} $$ Furthermore, $f(0)=-2+F_3=0$ and $f(1)=-3+F_4=0$.
Therefore, the solution to the original question, and the question in the title, is $$ \bbox[5px,border:2px solid #C0A000]{f(n)=F_{n+3}-n-2} $$
The Edited Question
The equation that needs to be satisfied is $$ \left(S^2-S-1\right)f(n)=n+2 $$ $$ \begin{align} \left(S^2-S-1\right)(\color{#C00}{-3}\color{#090}{-n}\color{#00F}{+2F_{n+1}+F_{n+2}}) &=\color{#C00}{3}\color{#090}{+n-1}\color{#00F}{+0}\\ &=n+2 \end{align} $$ Furthermore, $f(0)=-3+2F_1+F_2=0$ and $f(1)=-4+2F_2+F_3=0$.
Therefore, the solution to the edited question is $$ \bbox[5px,border:2px solid #C0A000]{f(n)=2F_{n+1}+F_{n+2}-n-3} $$
The Finally Edited Question
The equation that needs to be satisfied is $$ \left(S^2-S-1\right)f(n)=n+1 $$ $$ \begin{align} \left(S^2-S-1\right)(\color{#C00}{-2}\color{#090}{-n}\color{#00F}{+2F_{n+2}}) &=\color{#C00}{2}\color{#090}{+n-1}\color{#00F}{+0}\\ &=n+1 \end{align} $$ Furthermore, $f(0)=-2+2F_2=0$ and $f(1)=-3+2F_3=1$.
Therefore, the solution to the finally edited question is $$ \bbox[5px,border:2px solid #C0A000]{f(n)=2F_{n+2}-n-2} $$