Question: What am I doing wrong in constructing this loop?

Suppose the loop goes something like:

a[1] =3;
a[2] = 2;
a[3] = -2;

for i from 3 to 60 do

a[i+1] := a[i] + 3*a[i-1] + 2*a[i-2];

end do:

 

a(60);

 

I get some long expression, and then I have to do subs(....,%); to evaluate it at the already defined values and get the answer. Why isn't it evaluating it with the already defined initial values?

Please Wait...