solve_rec problem



Richard Hennessy a ?crit :
> I think I don't understand solve_rec() in the solve_rec package.
>  
> I tried
>  
> (%i13) display2d:false;
> (out13) false
> (%i14) solve_rec(a[i]=x*a[i-1]/(6*i*(6*i+1)),a[i]);
> (out14) a[i] = gamma(1/6)*%k[1]*6^(1-2*i)*x^i/(6*i!*gamma(i+7/6))
> (%i15) solve_rec(a[i]=x*a[i-6]/(i*(i+1)),a[i]);
> (out15) false
>  
> Should the answer in the second case not be false, I have the 
> recurrence relation which skips over 5 terms so a[i] = f(a[i-6]) but 
> why do I have to rewrite it so a[i]=f(a[i-1])?
>  
> Rich
>  
Hello Richard,

in principle, you may skip terms in a recurrence relation if you wish. 
This just makes the result more complex, possibly not expressible in 
terms of  usual functions.

For instance the so-called double factorial (see 
http://en.wikipedia.org/wiki/Factorial#Double_factorial) defined by 
f(n)=1 for n<2 and f(n)=n.f(n-2) for n>1 is not solved :
(%i3) solve_rec(a[i]=i*a[i-2],a[i]);
(%o3) false

But the simpler recurrence f(n)=2.f(n-2) , which also skips one term, is 
solved :
(%i4) solve_rec(a[i]=2*a[i-2],a[i]);
(%o4) a[i] = %k[1]*2^(i/2)*(-1)^i+%k[2]*2^(i/2)

and also f(n)=2.f(n-6) :
(%i5) solve_rec(a[i]=2*a[i-6],a[i]);
(%o5) a[i] = %k[3]*2^(i/6)*(-1)^i+%k[6]*2^(i/6)
                                 +(2^(1/6)-2^(1/6)*sqrt(3)*%i)^i*%k[5]/2^i
                                 +(-2^(1/6)*sqrt(3)*%i-2^(1/6))^i*%k[4]/2^i
                                 +(2^(1/6)*sqrt(3)*%i-2^(1/6))^i*%k[2]/2^i
                                 +(2^(1/6)*sqrt(3)*%i+2^(1/6))^i*%k[1]/2^i

Your second case seems to be just too complex to be solved (and 
definitely doesn't represent the same sequence as your first case !).

Hope this helps.

Eric Reyssat