# [Maxima] question on solve_rec and solve_rec_rat

Andrej Vodopivec andrej.vodopivec at gmail.com
Tue Mar 6 02:13:31 CST 2012

```On Sun, Mar 4, 2012 at 12:48 PM, Oliver Kullmann
<O.Kullmann at swansea.ac.uk> wrote:
> a[n] = (sqrt(5)-1)^n*%k[1]*(-1)^n/2^n-n/(5*2^n)+(sqrt(5)+1)^n*%k[2]/2^n-2^(1-n)/5
>
> Again we find %k. Perhaps these are the initial conditions?
> Apparently k[1] = a[0] and k[2] = a[1].
>
> This one should say in the documentation.
>
> It would also be good to show this example with initial conditions
> (actually, just giving the same example for a, but this time specifying one
> or two initial conditions would give a good hint what that %k is for --- but
> it can't hurt to also say it directly).

A general solution of a recurrence equation contains some parameters,
which are represented as %k[1],...,%k[d]. This are not initial terms,
but if initial terms are provided, then the values for parameters can
be computed.

> Next I try
> solve_rec_rat(t[n]=n*t[n-1]+n*n+1, t[n], t[0]=1);
> and get an error:
>
> "Too many" arguments supplied to solve_rec_rat(eqn,fn); found:
>          [t[n] = n*t[n-1]+n^2+1,t[n],t[0] = 1]
>  -- an error. To debug this try: debugmode(true);

This is a bug in the documentation. solve_rec_rat does not accept
initial terms as a parameter.

Andrej
```