Bill Allombert on Wed, 15 Jan 2025 22:43:36 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

script for linear recurrences with polynomial coefficients


Dear PARI users,

I have written a simple GP script to deal with linear recurrences with polynomial coefficients.
It is available here https://pari.math.u-bordeaux.fr/Scripts/rec.gp
This is preliminary work.

For example
R = [-2,(n-1)^3;-1,-(34*n^3-51*n^2+27*n-5);0,n^3]
is the relation
(n-1)^3*u_{n-2} -(34*n^3-51*n^2+27*n-5) * u_{n-1} + n^3*u_n
(-2 means u_{n-2}, etc.)

V=reccoefs(R,[0,6],30)
give 30 terms starting by 0,6

recfind allow to find the relations from the sequence:
? recfind(V,[-2,-1,0],3)
%7 = [[-2,x^3-3*x^2+3*x-1;-1,-34*x^3+51*x^2-27*x+5;0,x^3]]

reccheck allow to check if a sequence satisfies a given relation.

Cheers,
Bill