On Feb 10, 9:55 am, Harald Schilly <harald.schi...@gmail.com> wrote: > > For example, how could I have Sage give me the general formula of > > fibonacci's sequence ? :-) > > I wasn't able to do that one
Perhaps like that: sage: from sympy import * sage: y = Function('y') sage: n = Symbol('n',integer=True) sage: f = y(n+2) - y(n+1) - y(n) sage: rsolve(f,y(n)) C0*(1/2 + 5**(1/2)/2)**n + C1*(1/2 - 5**(1/2)/2)**n Isn't that the general Fibonacci formula? If I understand the documentation ("rsolve?") correctly, f must be a relation that is linear in finitely many terms of y with hypergeometric coefficients. In other words, if you insert y(n) into f then the result is zero for all n. Cheers, Simon -- To post to this group, send email to sage-support@googlegroups.com To unsubscribe from this group, send email to sage-support+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org