rsolve example symbol

20 views
Skip to first unread message

Raymond Rogers

unread,
Mar 27, 2015, 12:51:09 PM3/27/15
to sy...@googlegroups.com
I am attempting to rsolve a recursion and am having a problem.  Doctoring up the first example the live window follows.  Please note that I changed (n**2 + 3*n - 2) to (n**2 + 3*n - k) and then no output results. Is this because it won't handle parameters or am I supposed to do things differently?
Ray

Python console for SymPy 0.7.6 (Python 2.7.5) These commands were executed: >>> from __future__ import division >>> from sympy import * >>> x, y, z, t = symbols('x y z t') >>> k, m, n = symbols('k m n', integer=True) >>> f, g, h = symbols('f g h', cls=Function)
>>> from sympy import Function, rsolve
>>> f = (n - 1)*y(n + 2) - (n**2 + 3*n - 2)*y(n + 1) + 2*n*(n + 1)*y(n)
>>> rsolve(f, y(n))
2nC0+C1n!
>>> from sympy import Function, rsolve
>>> from sympy.abc import n
>>> from sympy.abc import n
>>> y = Function('y')
>>> y = Function('y')
>>> f = (n - 1)*y(n + 2) - (n**2 + 3*n - 2)*y(n + 1) + 2*n*(n + 1)*y(n)
>>> rsolve(f, y(n))
2nC0+C1n!
>>> f = (n - 1)*y(n + 2) - (n**2 + 3*n - k)*y(n + 1) + 2*n*(n + 1)*y(n)
>>> rsolve(f, y(n))
Reply all
Reply to author
Forward
0 new messages