I guess it should have been like this?
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));
a(4);
subst ( [ z(1) = r1, y(2) = s*c1, z(3)=r3,y(4)=s*c2 ], a(4));
hugo
On Thu, 12 May 2011, Stavros Macrakis wrote:
> For a (1) etc. read x(1)
>
> T-Mobile. America?s First Nationwide 4G Network
>
> 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
>