In my research I often need to find polynomial relations between power series and number sequences. For example, in my essay "A Multisection of q-Series", I trisect a specific power series $\, A = A_0 + A_1 + A_2 \,$ and find a homogeneous cubic polynomial relation $\, 0 = A_2A_0^2 + A_0A_1^2 + A_1A_2^2\,$ between the three sections. Another example is in my note "A Remarkable eta-product Identity" which is one of the many "Dedekind eta-product identities" that I collected.
Many years ago I wrote code in PARI/GP which can find such relations
automatically, essentially by finding the kernel of a constructed matrix.
I could just translate my gp
code into Wolfram
code but I wonder
if the functionality already exists and I just don't know about it. I
do essentially the same thing in PARI/GP with sequences instead of power series. Again, I wonder if the functionality already exists since
the two functions I wrote are so useful for my own research purposes and it is likely that others may find the functionality useful also.
As a specific, concrete example for sequences, consider the sequence OEIS A006720 given by the initial values $a(0)=a(1)=a(2)=a(3)=1$ and the recursion $$a(n) = (a(n-1)a(n-3) + a(n-2)^2) / a(n-4).$$ Define the shifted sequences $a_k(n) = a(n+k).$ In Wolfram code define some functions and lists:
ClearAll[a, c1,c2, a0,a1,a2,a3,a4,a5, x1,x2,x3,x4,x5,x6];
(* Define the sequence A006720 *)
a[0] = a[1] = a[2] = a[3] = 1;
a[n_] := (a[n] = (a[n-1]*a[n-3] + a[n-2]^2)/a[n-4]);
(* Initialize the finite shifted sequences *)
a0=Array[a, 26, 0]; a1=Drop[a0, 1]; a2=Drop[a1, 1];
a3=Drop[a2, 1]; a4=Drop[a3, 1]; a5=Drop[a4, 1];
(* Solve for the coefficients of some quadratic homogeneous relations *)
Solve[Table[a0[[n]]*a4[[n]] == c1*a1[[n]]*a3[[n]]+c2*a2[[n]]^2, {n,21}],{c1,c2}]
(* {{c1->1,c2->1}} *)
Solve[Table[a1[[n]]*a5[[n]] == c1*a2[[n]]*a4[[n]]+c2*a3[[n]]^2, {n,21}],{c1,c2}]
(* {{c1->1,c2->1}} *)
Solve[Table[a0[[n]]*a5[[n]] == c1*a1[[n]]*a4[[n]]+c2*a2[[n]]*a3[[n]], {n,21}],{c1,c2}]
(* {{c1->-1,c2->5}} *)
A proposed Wolfram
equivalent of my gp
function might behave like this:
findSequenceRelation[2, 21, {a0, a1, a2, a3, a4, a5}, {x1, x2, x3, x4, x5, x6}]
(* {x3^2 + x4*x2 - x5*x1, 5*x4*x3 - x5*x2 - x6*x1, x4^2 + x5*x3 - x6*x2} *)
which returns three linearly independent degree $2$ polynomial relations
(when equated to zero) between the six finite sequences
{a0, a1, a2, a3, a4, a5}
using the first $21$ terms of the sequences and where, in the output, the six sequences are referred
to as {x1, x2, x3, x4, x5, x6}
similar to the way that the Wolfram
function SymmetricReduction
uses its optional last argument.
A previous question Efficient way of finding poynomial relation is another concrete example.
Notice the following details:
- The first expression in the returned list, namely
x3^2 + x4*x2 - x5*x1
(when equated to zero), corresponds to the first polynomial relation $a(n)a(n+4) = a(n+1)a(n+3) + a(n+2)^2$. - The total degree of the polynomial relations sought is given as the first argument.
- The number of terms of each sequence to use is given as the second argument.
- The list of the sequences themselves is given as the third argument.
- The optional fourth argument is a list of symbols to use to refer to the
sequences in the output. The default is to use
{x1, x2, x3, ...}
. - If one of the sequences is a constant sequence, then the polynomial relation need not be homogeneous.
- A proposed very similar function
findSeriesRelation
would find polynomial relations between given power series instead of sequences. - The Wolfram function
FindLinearRecurrence
almost solves the degree 1 case for sequences (but see next item) and perhaps a higher degree extension may exist already. - In general, the sequences and power series need not have any obvious connection (that is, the sequences need not be shifted copies of the same sequence), but if there exists polynomial relations of the given degree, then the function will find a basis for them.