On Feb 10, 9:54 am, Nathann Cohen <[email protected]> wrote:
> I just learnt about the "rsolve" function from Maple, which seems to
> give the formula of sequences defined by recurrence.. Is there a
> similar function in Sage ?
sympy has rsolve
>
> For example, how could I have Sage give me the general formula of
> fibonacci's sequence ? :-)
I wasn't able to do that one (bug or i don't understand what i'm
doing), but let me quote the doctest:
from sympy import *
>>> y = Function('y')
>>> n = Symbol('n', integer=True)
>>> f = (n-1)*y(n+2) - (n**2+3*n-2)*y(n+1) + 2*n*(n+1)*y(n)
>>> rsolve(f, y(n))
C0*n! + C1*2**n
>>> rsolve(f, y(n), { y(0):0, y(1):3 })
-3*n! + 3*2**n
--
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/sage-support
URL: http://www.sagemath.org