How To Generate As Many Somos-Like Miracles as You Wish

Shalosh B. EKHAD and Doron ZEILBERGER^{1}

Dedicated to the GURU of Non-Linear Recurrence Equations, Gerry LADAS

Dedication

It is a great pleasure to dedicate this article to Gerry Ladas, who along with Saber Elaydi, made Difference Equations such an active and exciting field.

Somos Sequences

In the late 1980s, Michael Somos came up with an amazing set of conjectures, featuring non-linear recurrences that always yield integers. The most famous one was Somos-4: [S]http://oeis.org/A006720. Define a sequence {a(n)}_{n=1}^{∞} by a(1) = 1 , a(2) = 1 , a(3) = 1 , a(4) = 1, and for n ≥ 5,

a(n) = \frac{a(n − 1)a(n − 3) + a(n − 2)^{2}}{a(n − 4)} .

Prove that a(n) is an integer for every n ≥ 1. This is indeed amazing, since, starting at n = 9, you divide by an integer larger than 1, and a-priori you are only guaranteed to get rational numbers, but surprise-surprise, you always (seem) to get integers.

This took quite some effort to prove rigorously. Of course, confirming it for n ≤ 300, say, already constitutes a (very convincing!) empirical proof, but mathematicians do not care about truth perse, they only care about playing their (sometimes fun but often very dull) artificial game called proving (“rigorously”, using logical deduction).

And indeed, such a mathematical (elegant!) proof was given by Janice Malouf[M]. Other people gave other proofs, see the references given at [S] http://oeis.org/A006720.

Of course, Michael Somos is a honest person. He first encountered this sequence in some context, and then made his conjecture. But suppose that you are dishonest, and want to amaze your friends (or challenge your foes) with such Somos Phenomena, coming up with non-linear recurrences where you know beforehand, that you are guaranteed to get integers, and even have a fully rigorous proof of that fact.

Then you must follow the advise of Carl Gustav Jacob Jacobi who taught us that in order to make life simpler,

“man muss immer umkehren” , in other words, work backwards! Instead of trying to play darts, by placing the target on the wall, and then aiming from a distance of twenty meters, and most probably missing it, one first throws the dart, and then draws the bull’s eye!

1 Department of Mathematics, Rutgers University (New Brunswick), Hill Center-Busch Campus, 110 Frelinghuysen

Rd., Piscataway, NJ 08854-8019, USA. zeilberg at math dot rutgers dot edu , http://www.math.rutgers.edu/~zeilberg/ . March 21, 2013. Accompanied by Maple package NesSomos downloadable from Zeilberger’s website. Supported in part by the NSF.

Consider the linear recurrence sequence defined by

f(1) = 1 , f(2) = 3 , f(n) = 3f(n − 1) − f(n − 2) (n ≥ 3) .

Obviously (by induction on n) they are all integers.

Consider, on the other hand, the following sequence

b(1) = 1 , b(2) = 3 , b(n) = \frac{b(n − 1)^{2} − 1}{b(n − 2)} (n ≥ 3) ,

now it is not at all immediately obvious that the b(n) are always integers.

Suppose that one asked the question “prove that the b(n) are always integers”. The best way to prove it would be to generate the first few terms, go to Neil Sloane’s OEIS[S], and find out that b(n) = A001519(n). In other words it is the same as the above sequence f(n), at least for the first 30 terms.

So far it is only a “conjecture”, but if you know about the C-finite ansatz ([K][KP][Z1][Z2]), then knowing that f(n) = b(n) for 1 ≤ n ≤ 4 implies that it is true for all n ≥ 1, thereby yielding an ‘empirical’, yet fully rigorous, proof!

It is easy to see that C-finite sequences, i.e. sequences that satisfy linear recurrence equations with constant coefficients, also satisfy (many!) non-linear recurrences. But more surprisingly, the same is true for any subsequence where the places are either polynomials (e.g. n^{2}) or exponential (e.g. 2^{n}), or even exponential polynomial (e.g. n^{2}2^{n} + n^{4}3^{n}). For example, if F (n) are the Fibonacci numbers defined by F (0) = 0, F (1) = 1, F (n) = F (n − 1) + F (n − 2)(n ≥ 2), then the sequence

a(n) := F (n^{2}2^{n} + n^{3}5^{n} + 1)

satisfies some (very complicated!) non-linear recurrence equation, i.e. there exists a positive integer r (the order) and a polynomial P (x_{0}, …, x_{r}) such that

P (a(n), …, a(n + r)) = 0 (for all n ≥ 1).

Furthermore, by possibly increasing r, one can demand that the degree in x_{r} is 1, so one can express a(n + r) as a rational function of a(n), …, a(n + r − 1) and get a genuine non-linear recurrence that very surprisingly (if you don’t know how it was found!) yields integers.

Of course the same is true for any sequence that satisfies a linear recurrence equation with constant coefficients.

So let’s state the main theorem in its intimidating full generality.

Main Theorem: Let f(n) be a sequence satisfying a linear recurrence equation with constant coefficients

f(n) = ∑_{i=1}^{d} c_{i}f(n − i) ,

for some constants c_{1}, …, c_{d}, and with some given initial conditions f(1), …, f(d). Let p(n) be of the form, for some specific integer m,

p(n) := P OL(n, 2^{n}, 3^{n}, …, m^{n}) ,

where P OL is some polynomial of m variables. Then there exists an integer r and a polynomial P (x_{0}, …, x_{r}), of degree 1 in x_{r} such that the subsequence a(n) := f(p(n)) satisfies the non-linear recurrence

P (a(n), …, a(n + r)) = 0 (n ≥ 1) .

The formal proof of this theorem would be very boring, but its informal proof, at least generically, is not too bad. Using Binet’s formula, one can express f(n) “explicitly” as a linear combination of α^{n} (and possibly nα^{n}, n^{2}α^{n} etc. in case of multiple roots) where the α’s are roots of the equation

1 = ∑_{i=1}^{d} c_{i}α^{−i} .

By using the initial conditions, one can find the coefficients in that linear combination of the α^{n}’s, that are also certain expressions in the α’s. Then, since α^{(n+1)^{2}} = α^{n^{2}}(α^{n})^{2}α, α^{2^{n+1}} = (α^{2^{n}})^{2} etc. one can introduce auxiliary variables, {α^{n}, α^{n^{2}}, α^{n^{3}}, …, α^{2^{n}}, α^{3^{n}}, …}, (finitely many!), and recall that the α’s all satisfy the algebraic equation above (and enjoy nice relations amongst themselves, e.g. that their sum is c_{1} and their product is (−1)^{d−1}c_{d}).

Now one can express f(p(n)) in terms of these auxiliary variables, and by elimination (in principle using the Buchberger algorithm), one can get, for some r, a pure polynomial relation, of the desired form P (a(n), …, a(n + r)) = 0, and even demand that the degree in a(n + r) is one, so that one can express a(n + r) as a rational function of a(n), …, a(n + r − 1).

In practice, it is better to use undetermined coefficients. Fixing r and d, write a generic polynomial P (x_{0}, …, x_{r}) of total degree d (and degree 1 in x_{r}), plug-in the expressions in terms of the auxiliary variables, get a huge polynomial in these variables, set up all the coefficients (w.r.t. the auxiliary variables) of the numerator to 0, and solve the large system of linear equations where the unknowns are the “undetermined coefficients”, thereby hopefully making them determined. If the only solution is the trivial zero solution, don’t give up! Just raise d and/or r.

Now if we take the coefficients of the recurrence c_{1}, …, c_{d} to be integers, and the initial conditions f(1), …, f(d) to be integers as well, then the sequence f(n) obviously consists of only integers. If, in addition, the polynomial P OL has all positive integer coefficients, then we are guaranteed, a priori, that the terms of the subsequence a(n) := f(p(n)) are all integers!

For example, if our sequence is f(n) = F_{2n}, i.e. f(1) = 1 , f(2) = 3 , f(n) = 3f(n − 1) − f(n − 2) (n ≥ 3), considered above, then the Binet formula is

f(n) = \frac{α^{n} − α^{−n}}{α − α^{−1}} ,

where α is a root of the quadratic equation α^{2} − 3α + 1 = 0. Taking p(n) = n^{2} we get

a(n) = \frac{α^{n^{2}} − α^{−n^{2}}}{α − α^{−1}} .

Now

a(n + 1) = \frac{α^{(n+1)^{2}} − α^{−(n+1)^{2}}}{α − α^{−1}} = \frac{α^{n^{2}}(α^{n})^{2}α − α^{−n^{2}}(α^{−n})^{2}α^{−1}}{α − α^{−1}}

a(n + 2) = \frac{α^{(n+2)^{2}} − α^{−(n+2)^{2}}}{α − α^{−1}} = \frac{α^{n^{2}}(α^{n})^{4}α^{4} − α^{−n^{2}}(α^{−n})^{4}α^{−4}}{α − α^{−1}} .

So you have expressions for a(n),a(n + 1), a(n + 2), as rational functions in the auxiliary variables A := α^{n}, B := α^{n^{2}} (and α, but α satisfies α^{2} − 3α + 1 = 0). So generically we should have a second-order polynomial relation P (a(n), a(n + 1), a(n + 2)) = 0. But it is not of degree one in a(n + 2). If we allow higher-order recurrences, it turns out that we have a fairly nice non-linear recurrence of order 5. Here is one such example.

Prop. Let a(n) be defined by

a(1) = 1 , a(2) = 21 , a(3) = 2584 , a(4) = 2178309 , a(5) = 12586269025

and for n ≥ 6, by the recurrence

a(n) = ( 2303 a(n − 4)a(n − 3)a(n − 1) + 2255 a(n − 3)^{2}a(n − 2) + 329a(n − 4)a(n − 1)^{2}

− 15792 a(n − 4)a(n − 2)^{2} + 329 a(n − 4)a(n − 3)^{2} − 2303 a(n − 4)^{2}a(n − 2) + 441 a(n − 2)

− a(n−2)^{3}−2961 a(n−4) − a(n−5)a(n−2)a(n−1) + 329 a(n−5)a(n−3)a(n−2) )/( 48 a(n−4)a(n−2) ) ,

then a(n) are all integers!

For many more such propositions, see:

http://www.math.rutgers.edu/~zeilberg/tokhniot/oNesSomos3 .

The much sparser subsequence, a(n) := f(2^{n}) satisfies a much simpler (second-order!) non-linear recurrence:

a(n) = \frac{a (n − 1) (4 + 5 a (n − 1)^{2})}{2 + 5 a (n − 2)^{2}}

subject to the initial conditions

a(1) = 3 , a(2) = 21 .

The Maple package NesSomos

Everything is implemented in the Maple package NesSomos (written by DZ) available directly from

http://www.math.rutgers.edu/~zeilberg/tokhniot/NesSomos ,

and that is linked to from the “front” of this article

http://www.math.rutgers.edu/~zeilberg/mamarim/mamarimhtml/somos.html , where one can

also find three long webbbooks generated by SBE.

To get a list of the main procedures, type ezra();, and for help with a specific procedure, type ezra(ProcedureName);. Let’s just list the more important procedures.

• FindREL(LPols,Vars,x,d) is a very general procedure that inputs a list of rational functions LPols in the list of variables Vars, a symbol, x, and a positive integer d, and outputs a polynomial of degree ≤ d, let’s call it P (x[1], …, x[r]) such that

P (LP ols[1], …, LP ols[r]) = 0 .

For example,

F indREL([p^{2} − q^{2}, 2pq, p^{2} + q^{2}], [p, q], x, 2);

yields

x_{3}^{2} − x_{2}^{2} − x_{1}^{2} = 0 .

If nothing is found, then it returns F AIL and one has to increase d. Of course in order to guarantee that there is such a good d, we must insist that the length of LPols is larger than the length of

Vars.

• FindInREL(LPols,Vars,x,d) is exactly as above, but, in addition, the output should have degree one in x[r] (where r is the length of LPols)). This is needed for the application to generating Somoslike sequences.

• FindSMpG(c,p,n,Maxr,d,a); inputs a positive integer c, a polynomial expression p in the discrete variable n, positive integers Maxr and d, and a symbol a, and outputs a non-linear recurrence, of order Maxr and degree ≤ d satisfied by the sequence a(n) := f(p(n)), where f(n) is the sequence satisfying f(n) = cf(n − 1) − f(n − 2) and f(0) = 0, f(1) = 1. If it fails it returns FAIL, and the human has to try again with a larger d and/or Marx. The first amazing example above was gotten from

FindSMpG(3,n**2,n,5,6,a);

• FindSMeG(c,e,n,Maxr,d,a); inputs a positive integer c, a positive integer e, positive integers Maxr and d and a symbol a, and outputs a non-linear recurrence of order Maxr and degree ≤ d satisfied by the sequence f(e^{n}), where f(n) is the sequence satisfying f(n) = cf(n − 1) − f(n − 2) and f(0) = 0, f(1) = 1. If it fails it returns FAIL. The second amazing example above was gotten from:

FindSMeG(3,2,n,3,3,a);

Webbbooks For many amazing Somos-like miracles see the three webbooks

• http://www.math.rutgers.edu/~zeilberg/tokhniot/oNesSomos1
• http://www.math.rutgers.edu/~zeilberg/tokhniot/oNesSomos3
• http://www.math.rutgers.edu/~zeilberg/tokhniot/oNesSomos4

Enjoy! Using NesSomos you can find many more Somos-like miracles on your own, impressing your friends and challenging your enemies. Laurent Phenomenon Analogous things can be done to generate sequences that have the so-called Laurent phenomenon, and even, a priori, the much stronger property of positivity. Encore By looking at the output of

http://www.math.rutgers.edu/~zeilberg/tokhniot/oNesSomos1 , we see a pattern that can

be summarized as follows. Proposition: Let c be a positive integer (a formal symbol), and define a sequence by

a(0) = 1 , a(1) = c ,

and for n ≥ 2,

a(n) = \frac{a(n − 1) (4 + (c − 2)(c + 2)a(n − 1)^{2} )}{2 + (c − 2)(c + 2)a(n − 2)^{2}} .

Then for all n ≥ 1, a(n) are integers (polynomials in c with integer coefficients). Proof: Consider the sequence defined by f(0) = 0, f(1) = 1 and for n ≥ 2 by

f(n) = cf(n − 1) − f(n − 2) .

Define b(n) := f(2^{n}). It is routine to prove that

b(n) = \frac{b(n − 1)(4 + (c − 2)(c + 2)b(n − 1)^{2})}{2 + (c − 2)(c + 2)b(n − 2)^{2}} ,

and, of course, b(0) = 1 and b(1) = c. Hence, by induction, b(n) = a(n) for all n ≥ 1. Since the f(n) are obviously integers (polynomials in c with integer coefficients), so are a(n).

References

[K] Manuel Kauers, SumCracker: A package for manipulating symbolic sums and related objects, Journal of Symbolic Computation 41 (2006), 1039-1057,

http://www.risc.uni-linz.ac.at/people/mkauers/publications/kauers06h.pdf .

[KP] Manuel Kauers and Peter Paule, “The Concrete Tetrahedron”, Springer, 2011.

[M] J. L. Malouf, “An integer sequence from a rational recursion”, Discr. Math. 110 (1992), 257-261.

[S] Neil Sloane, “The On-Line Encyclopedia of Integer Sequences”, http://oeis.org/ .

[Z1] 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, Oct. 2007,

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

[Z2] Doron Zeilberger, The C-finite Ansatz, to appear in the Ramanujan Journal.

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