Automated Proofs of Many Conjectured Recurrences in the OEIS made by R.J. Mathar

Shalosh B. EKHAD, Mingjia YANG and Doron Zeilberger

The On-Line Encyclopedia Of Integer Sequence (OEIS) ([Sl]), that wonderful resource that most combinatorialists, and many other mathematicians and scientists, use at least once a day, is a treasure trove of mathematical information, and one of its charms is that it contains many intriguing conjectures. But one should be on one’s guard, because some of the conjectures are either already theorems, or can be routinely proved.

As pointed out in [Z1], all identities involving sequences that belong to the C-finite ansatz can be proved by checking sufficiently many initial special cases, and the number of such checks is usually very small, and the number of initial values needed to make the “empirical” proof rigorous can be easily found.

Recall that a sequence is C-finite if it satisfies a homogeneous linear recurrence equation with constant coefficients, the most famous members being sequence A000079 (https://oeis.org/A000079), namely a(n) = 2^{n}, satisfying the recurrence a(n) − 2a(n − 1) = 0 and sequence A000045 (https://oeis.org/A000045), satisfying the recurrence F (n) − F (n − 1) − F (n − 2) = 0.

Things are not so simple with the P -recursive ansatz (see [Z2]), the class of sequences satisfying a homogeneous linear recurrence equation with polynomial coefficients, the most famous one being sequences A000142 (https://oeis.org/A000142), n!, satisfying the recurrence a(n) − n a(n−1) = 0. Many sequences can be shown, by purely theoretical a priori arguments, to be P -recursive, so it seems that in order to prove that two differently defined P -recursive sequences a(n) and b(n) are actually equal, it should suffice to check sufficiently many initial values. Alas, while it is true that the sequence c(n) := a(n) − b(n) is also P -recursive, if you don’t know the explicit recurrence that it satisfies, it is conceivable (albeit extremely unlikely) that even if it satisfies a low-order, say, second-order, recurrence, it is something like

( n − 10^{1000000} ) a(n) + (n + 1)a(n − 1) + (n − 3) (n − 2) = 0 ,

in other words it has a ‘singularity’ at a very large positive integer, and the ‘finitely many’ values one has to check is 10^{1000000} + 2 rather than 2.

In such cases, to be completely rigorous, one has to actually find the recurrences, and check that they do not have such singularities, or if they do, find the largest positive integer that is a singularity.

One case where it is relatively painless (for the computer) to explicitly find a recurrence for a sequence, is the case of what is called the Schützenberger ansatz in [Z2], i.e. sequences {a(n)}_{0}^{∞} whose ordinary generating functions

f(x) = ∑_{n=0}^{∞} a(n) x^{n} ,

satisfy equations of the form P (f(x), x) = 0, where P is a polynomial of two variables. More explicitly, there exists a positive integer A, and polynomials p_{i}(x), i = 0, 1, …, A, such that

∑_{i=0}^{A} p_{i}(x)f(x)^{i} = 0 .

These are discussed in the Flajolet-Sedgewick bible, [FS].

By a well-known algorithm (that by today’s standards is fairly straightforward), that goes back to the 19th century, and is implemented, inter alia, in Bruno Salvy and Paul Zimmermann’s Maple package gfun, as function algtodiffeq, every algebraic formal power series satisfies a linear differential equation with polynomial coefficients

∑_{i=0}^{L} q_{i}(x)\frac{d^{i}}{dx^{i}} f(x) = 0 ,

that immediately translates (by writing f(x) = ∑_{n=0}^{∞} a(n)x^{n}, substituting into the above differential equation, and setting the coefficient of x^{n} to 0), to a linear recurrence equation with polynomial coefficients, satisfied by the sequence a(n)

∑_{i=0}^{M} c_{i}(n)a(n − i) = 0 .

This is implemented in the function diffeqtorec in gfun.

Mathar’s conjectures

When we searched the OEIS, on July 7, 2017, for

Conjecture AND recurrence AND Mathar ,

we got 450 hits. Many of them concern the sequences of coefficients of generating functions given in terms of radicals. While Abel, Galois, and Ruffini famously proved that not every algebraic function can be expressed in terms of radicals, the converse is trivially true.

Let’s take for example, sequence A004148 (https://oeis.org/A004148), where a generating function (conjectured by Michael Somos) is given

f(x) = \frac{1 − x + x^{2} − \sqrt{1 − 2 x − x^{2} − 2 x^{3} + x^{4}}}{2 x^{2}} .

Obviously this is an algebraic formal power series, and the algebraic equation satisfied by f(x) may be routinely obtained by clearing radicals. Alas, one often gets a higher order recurrence than the one conjectured. To prove that the simpler conjectured recurrence also satisfies this sequence one proceeds as follows.

Proving that a Lower-Order Recurrence is Equivalent to a Higher-Order Recurrence

Let N be the forward shift operator:

Na(n) := a(n + 1) ,

then the fact that the sequence {a(n)}_{0}^{∞} satisfies a recurrence

∑_{i=0}^{M} c_{i}(n)a(n − i) = 0 ,

is equivalent to the fact that

(∑_{i=0}^{M} c_{i}(n)N^{−i}) a(n) ≡ 0 .

Calling the operator on the left C(n, N), we have

C(n, N)a(n) ≡ 0 .

The class of linear recurrence operators with polynomial coefficients is a non-commutative algebra, where everything commutes except n and N, where the commutation relation between n and N is Nn − nN = N. See [Z3] for a primer.

We say that the sequence a(n) is annihilated by the operator C(n, N). Of course, any left-multiple of an annihilator is yet-another annihilator. For example, since

(N − 1)(N^{2} − N − 1) = N^{3} − 2N^{2} + 1 ,

the Fibonacci numbers can be also defined by the recurrence, and initial conditions

F_{n+3} = 2F_{n+2} − F_{n} ; F_{0} = 0 , F_{1} = 1 , F_{2} = 1 ,

but it would not make William of Ockham happy.

The Euclidean division algorithm for the commutative case is easily generalized to the case of the non-commutative algebra of linear recurrence operators with rational-function coefficients. If A(n, N) is such a (monic) operator of order d_{1} and B(n, N) is such a (monic) operator of order d_{2}, with d_{1} > d_{2} then there exist operators Q(n, N) (the quotient), of order d_{1} − d_{2}, and R(n, N) (of order < d_{2}), the remainder, such that

A(n, N) = Q(n, N)B(n, N) + R(n, N) .

So suppose that we have a rigorous proof that the operator A(n, N) annihilates our sequence, but by pure guessing, we found that the sequence is also annihilated by an operator of lower order, B(n, N), in other words, there exists a lower-order recurrence. If, using this algorithm (that we implemented), it turns out that R(n, N) = 0, it would follow that

A(n, N) = Q(n, N)B(n, N) .

Since we know, rigorously, that A(n, N)a(n) ≡ 0, it follows that

(Q(n, N)B(n, N))a(n) ≡ 0 .

Hence

Q(n, N)( B(n, N)a(n) ) ≡ 0 .

Defining b(n) := B(n, N)a(n), we get Q(n, N)b(n) = 0, and since we already know that b(i) = 0 for the first few values of i, we have a rigorous proof that b(n) = 0 for all n, and hence that a(n) is annihilated by the lower-order linear recurrence operator B(n, N).

The Maple package SCHUTZENBERGER.txt

While many of the needed functions can be found in the Maple package gfun [SZ] mentioned above, we found it more convenient to write our own Maple code, SCHUTZENBERGER.txt, available from

http://www.math.rutgers.edu/~zeilberg/tokhniot/SCHUTZENBERGER.txt .

This is an extension of a Maple package (of the same name) written (many years ago) by Doron Zeilberger. It contains new procedures to automatically and effortlessly prove any Mathar-type conjecture.

Note: In fact, if you are lucky enough to have access to Maple Version 12, we recommend that you use instead:

http://www.math.rutgers.edu/ zeilberg/tokhniot/SCHUTZENBERGER12.txt ,

that, at least for our purposes, is much better.

The new procedures are listed by typing ezraOEIS();, while the old ones can be seen by typing ezra();. To get help on any of these procedures, with an example, type:

ezra(ProcedureName); .

Procedure MatharConjs(), is a compilation of 33 such generating functions for which R.J. Mathar conjectured recurrences, that readers are welcome to extend.

Procedure OEISpaper(L,P,x,n,a), inputs such a list L (e.g. MatharConjs()) and it outputs a humanly-readable article, ready for submitting, with statements and proofs of all the conjectured recurrence listed in L. For example, typing:

OEISpaper(MatharConjs(),P,x,n,a);

outputs, in about 3 seconds, an article with 33 theorems, that can be seen in the output file

http://sites.math.rutgers.edu/~zeilberg/tokhniot/oMathar1maple12.txt .

[Note that in a few cases the recurrences that we found differ from those of Mathar, but we checked that they are equivalent.] An example using the Maple package SCHUTZENBERGER.txt to prove one of Mathar’s conjectures Have a Maple window, where you have uploaded the package, then type:

read `SCHUTZENBERGER.txt`: ,

then open another window, connected to the OEIS. Suppose that you see that R.J. Mathar conjectured a recurrence, for example OEIS sequence A000957, (https://oeis.org/A000957). Now search for “G.f” getting that the (ordinary) generating function for that sequence is

(1-sqrt(1-4*x))/(3-sqrt(1-4*x));

(for our human readers this is \frac{1−\sqrt{1−4 x}}{3−\sqrt{1−4 x}}). Then copy-and-paste this generating function into the Maple window, calling it, say, f;

f:=(1-sqrt(1-4*x))/(3-sqrt(1-4*x));

To get the recurrence conjectured by Mathar in computerese, type:

radtorec(f,x,n,N); ,

to get a statement of the recurrence, in humanese, type:

radtorecV(f,P,x,n,N,a): ,

and to get a statement and proof of the recurrence, still in humanese, type:

radtorecVwp(f,P,x,n,a): .

Conclusion While the fact that the sequence of coefficients of any generating function given in terms of radicals always satisfies some linear recurrence equation with polynomial coefficients is well known, it is apparently not as well-known as it should be, or else such recurrences would not be listed as “conjectures” in the OEIS. In the present case, before this article, for each and every such generating function, one had to work pretty hard to combine all the needed ingredients. After this article (and, more importantly, the new-improved version of SCHUTZENBERGER.txt), it can be done with just one command!

We believe that there exist quite a few other families of “conjectures” that are routinely provable and listed in the OEIS (and elsewhere) as “conjectures”. Since we know that if someone was “crazy” enough to actually go through the trouble of proving them using existing tools, it can be done, why bother? Since we know that a proof of the “conjecture” exists, checking it for the first 300 cases should suffice, and we propose to have a new category called “provable conjecture”, indicating that we know that there exists a proof, but we are too lazy to actually spell it out, and we are more than happy with the empirical verification.

In other words, the present article is a case study showing how it is done for this particular family of conjectures. But enough is enough. We don’t see the point of doing it for other families of provable conjectures. Knowing the fact that it is provable, plus convincing empirical evidence, suffices! Let’s focus on trying to prove conjectures that are not (yet) known to be provable.

References

[FS] P. Flajolet and R. Sedgewick, “Analytic Combinatorics”, Cambridge University Press, 2009.

[Freely(!) available on-line from http://algo.inria.fr/flajolet/Publications/book.pdf ]

[SZ] B. Salvy and P. Zimmermann, Gfun: a Maple package for the manipulation of generating and holonomic functions in one variable, ACM Trans. Math. Software 20 (1994).

[Sl] N. J. A. Sloane, The On-Line Encyclopedia of Integer Sequences (OEIS), oeis.org .

[Z1] Doron Zeilberger, The C-finite Ansatz, Ramanujan Journal 31(2013), 23-32.

http://sites.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/cfinite.html .

[Z2] Doron Zeilberger, An Enquiry Concerning Human (and Computer!) [Mathematical] Understanding, in: C.S. Calude, ed., “Randomness and Complexity, from Leibniz to Chaitin” World Scientific, Singapore, 2007, pp. 383-410.

http://sites.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/enquiry.html .

[Z3] Doron Zeilberger, Three recitations on holonomic functions and hypergeometric series, J. Symbolic Comp 20 (1995), 699-724 (originally appeared in 24th Séminaire Lotharingien, (Spring 1990.)

http://sites.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/loth.html .

Shalosh B. Ekhad, c/o D. Zeilberger, Department of Mathematics, Rutgers University (New Brunswick), Hill Center-Busch Campus, 110 Frelinghuysen Rd., Piscataway, NJ 08854-8019, USA.

ShaloshBEkhad at gmail dot com .

Mingjia Yang , Department of Mathematics, Rutgers University (New Brunswick), Hill Center-Busch Campus, 110 Frelinghuysen Rd., Piscataway, NJ 08854-8019, USA.

Email: my237 at math dot rutgers dot edu .