title: Solving recurrence using sympy
body: <p>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.</p>
  
  <p>My sympy code</p>
  
  <pre><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))
  </code></pre>
  
  <p>And output is</p>
  
  <blockquote>
    <p>C0 + (-n + 1)*(n/2 - 1)</p>
  </blockquote>