how to evaluate recursive function



subst ( [ a(1) = x, a(2) = y ... ], vvv )

Hugo Coolens <coolens at kahosl.be> wrote:

>I defined the following recursive formula:
>a(m):= if m=0 then 1 else if m=-1 then 0 else if mod(m,2)=1 then (z(m)*a(m-1)+a(m-2)) else (y(m)*a(m-1)+a(m-2))
>
>this gives me the expected expressions for different values of m e.g.
>a(4)=((z(1)*y(2)+1)*z(3)+z(1))*y(4)+z(1)*y(2)+1
>
>I now would like to (re)evaluate this result for z(1)=r1, y(2)=s*c1, 
>z(3)=r2, y(4)=s*c2
>
>How can this be done in Maxima?
>
>hugo
>
>_______________________________________________
>Maxima mailing list
>Maxima at math.utexas.edu
>http://www.math.utexas.edu/mailman/listinfo/maxima