I was trying to solve recurrence relation of fibonacci series using sympy. I got an answer which is different from that of the text book. Dont know where I got it wrong.
My sympy code
from sympy import *
f=Function('f')
var('y')
var('n',integer=True)
f=y(n)-y(n-1)+(n-2)
rsolve(f,y(n))
And output is
C0 + (-n + 1)*(n/2 - 1)
f
(=0
) you provide. Are you sure this is the correct form off
? I believe the recurrence relation of fibonacci series isf = y(n) - y(n-1) - y(n-2)
(=0
) – Papaverineprint rsolve(f,y(n),{y(0):1,y(1):1})
and getting None are result. – Radar