[I am using Maple 12.01 with Windows XP].

I tried to use gfun[listtorec] to find a recurrence for a particular sequence (given below), but the recurrence found is not correct.
Yet,  guessgf apparently gives the correct generating function.

>with(gfun):
>L:=[5, 8, 14, 24, 42, 72, 126, 216, 378, 648, 1134, 1944, 3402, 5832, 10206, 17496, 30618, 52488, 91854]:
>rec:=listtorec(L,u(t));
               [{-u(t + 2) + 3 u(t), u(0) = 5, u(1) = 8}, ogf]
 

This means: u(t+2) = 3*u(t)

Hence we have u(2) = 3*u(0) = 3*5 = 15, but u(2) should be 14.

If one uses guessgf  we get:

>lprint(guessgf(L,x)[1]):

-(5+8*x-x^2)/(-1+3*x^2)

Examining this carefully we see that the correct recurrence appears to be

(*)  u(0) = 5, u(1) = 8, u(2) = 14 and u(t) = 3*u(t-2) for t > 2.

Question 1: Is this a problem with listtorec? Or just something one has to live with and learn to circumvent?

Question 2:  Is there a simple command to go from

      -(5+8*x-x^2)/(-1+3*x^2)

to the recurrence(*).

Thanks in advance for any enlightening comments.

--Edwin

 


 

 


Please Wait...