maxima求递推式数值解

我在网上找了一圈都没解决,突然发现这是一个弱智问题。

 

 

例如f(n)=f(n-1)+f(n-2),f(0)=1,f(1)=1,求f(5):

$ rmaxima
Maxima 5.18.1 http://maxima.sourceforge.net
Using Lisp SBCL 1.0.28
Distributed under the GNU Public License. See the file COPYING.
Dedicated to the memory of William Schelter.
The function bug_report() provides bug reporting information.
(%i1) f(n):=(if (n<=1) then 1 else f(n-1)+f(n-2));
(%o1)          f(n) := if n <= 1 then 1 else f(n - 1) + f(n - 2)
(%i2) f(5);
(%o2)                                  8

 

 

你可能感兴趣的:(function,report,File,lisp)