Sylvester's sequence

In number theory, Sylvester's sequence is an integer sequence in which each term is the product of the previous terms, plus one. Its first few terms are
 * 2, 3, 7, 43, 1807, 3263443, 10650056950807, 113423713055421844361000443.

Sylvester's sequence is named after James Joseph Sylvester, who first investigated it in&thinsp;1880. Its values grow doubly exponentially, and the sum of its reciprocals forms a series of unit fractions that converges to 1 more rapidly than any other series of unit fractions. The recurrence by which it is defined allows the numbers in the sequence to be factored more easily than other numbers of the same magnitude, but, due to the rapid growth of the sequence, complete prime factorizations are known only for a few of its terms. Values derived from this sequence have also been used to construct finite Egyptian fraction representations of 1, Sasakian Einstein manifolds, and hard instances for online algorithms.

Formal definitions
Formally, Sylvester's sequence can be defined by the formula
 * $$s_n = 1 + \prod_{i=0}^{n-1} s_i.$$

The product of the empty set is 1, so this formula gives s0 = 2, without need of a separate base case.

Alternatively, one may define the sequence by the recurrence
 * $$\displaystyle s_i = s_{i-1}(s_{i-1}-1)+1,$$ with the base case s0 = 2.

It is straightforward to show by induction that this is equivalent to the other definition.

Closed form formula and asymptotics
The Sylvester numbers grow doubly exponentially as a function of n. Specifically, it can be shown that


 * $$s_n = \left\lfloor E^{2^{n+1}}+\frac{1}{2} \right\rfloor,\!$$

for a number E that is approximately 1.26408473530530... . This formula has the effect of the following algorithm:
 * s0 is the nearest integer to E&hairsp;2; s1 is the nearest integer to E&hairsp;4; s2 is the nearest integer to E&hairsp;8; for sn, take E&hairsp;2, square it n more times, and take the nearest integer.

This would only be a practical algorithm if we had a better way of calculating E to the requisite number of places than calculating sn and taking its repeated square root.

The double-exponential growth of the Sylvester sequence is unsurprising if one compares it to the sequence of Fermat numbers Fn&hairsp;; the Fermat numbers are usually defined by a doubly exponential formula, $$2^{2^n} \!+ 1$$, but they can also be defined by a product formula very similar to that defining Sylvester's sequence:


 * $$F_n = 2 + \prod_{i=0}^{n-1} F_i.$$

Connection with Egyptian fractions
The unit fractions formed by the reciprocals of the values in Sylvester's sequence generate an infinite series:
 * $$\sum_{i=0}^{\infty} \frac{1}{s_i} = \frac{1}{2} + \frac{1}{3} + \frac{1}{7} + \frac{1}{43} + \frac{1}{1807} + \cdots.$$

The partial sums of this series have a simple form,
 * $$\sum_{i=0}^{j-1} \frac1{s_i} = 1 - \frac{1}{s_j-1} = \frac{s_j-2}{s_j-1},$$

which is already in lowest terms. This may be proved by induction, or more directly by noting that the recursion implies that
 * $$\frac{1}{s_i-1}-\frac{1}{s_{i+1}-1} = \frac{1}{s_i},$$

so the sum telescopes
 * $$\sum_{i=0}^{j-1} \frac{1}{s_i} = \sum_{i=0}^{j-1} \left( \frac{1}{s_i-1}-\frac{1}{s_{i+1}-1} \right) = \frac{1}{s_0-1} - \frac{1}{s_j-1} = 1 - \frac{1}{s_j-1}.$$

Since this sequence of partial sums (sj − 2)/(sj −&thinsp;1) converges to one, the overall series forms an infinite Egyptian fraction representation of the number one:
 * $$1 = \frac12 + \frac13 + \frac17 + \frac1{43} + \frac1{1807} + \cdots.$$

One can find finite Egyptian fraction representations of one, of any length, by truncating this series and subtracting one from the last denominator:
 * $$1 = \tfrac12 + \tfrac13 + \tfrac16, \quad 1 = \tfrac12 + \tfrac13 + \tfrac17 + \tfrac1{42}, \quad 1 = \tfrac12 + \tfrac13 + \tfrac17 + \tfrac1{43} + \tfrac1{1806},\quad \dots.$$

The sum of the first k terms of the infinite series provides the closest possible underestimate of 1 by any k-term Egyptian fraction. For example, the first four terms add to 1805/1806, and therefore any Egyptian fraction for a number in the open interval (1805/1806,&thinsp;1) requires at least five terms.

It is possible to interpret the Sylvester sequence as the result of a greedy algorithm for Egyptian fractions, that at each step chooses the smallest possible denominator that makes the partial sum of the series be less than one.

Uniqueness of quickly growing series with rational sums
As Sylvester himself observed, Sylvester's sequence seems to be unique in having such quickly growing values, while simultaneously having a series of reciprocals that converges to a rational number. This sequence provides an example showing that double-exponential growth is not enough to cause an integer sequence to be an irrationality sequence.

To make this more precise, it follows from results of that, if a sequence of integers $$a_n$$ grows quickly enough that
 * $$a_n\ge a_{n-1}^2-a_{n-1}+1,$$

and if the series
 * $$A=\sum\frac1{a_i}$$

converges to a rational number A, then, for all n after some point, this sequence must be defined by the same recurrence
 * $$a_n= a_{n-1}^2-a_{n-1}+1$$

that can be used to define Sylvester's sequence.

conjectured that, in results of this type, the inequality bounding the growth of the sequence could be replaced by a weaker condition,
 * $$\lim_{n\rightarrow\infty} \frac{a_n}{a_{n-1}^2}=1.$$

surveys progress related to this conjecture; see also.

Divisibility and factorizations
If i < j, it follows from the definition that sj ≡ 1 (mod si&hairsp;). Therefore, every two numbers in Sylvester's sequence are relatively prime. The sequence can be used to prove that there are infinitely many prime numbers, as any prime can divide at most one number in the sequence. More strongly, no prime factor of a number in the sequence can be congruent to 5 modulo 6, and the sequence can be used to prove that there are infinitely many primes congruent to 7 modulo 12.

Much remains unknown about the factorization of the numbers in Sylvester's sequence. For instance, it is not known if all numbers in the sequence are squarefree, although all the known terms are.

As describes, it is easy to determine which Sylvester number (if any) a given prime p divides: simply compute the recurrence defining the numbers modulo p until finding either a number that is congruent to zero (mod p) or finding a repeated modulus. Using this technique he found that 1166 out of the first three million primes are divisors of Sylvester numbers, and that none of these primes has a square that divides a Sylvester number. The set of primes that can occur as factors of Sylvester numbers is of density zero in the set of all primes: indeed, the number of such primes less than x is $$O(\pi(x) / \log\log\log x)$$.

The following table shows known factorizations of these numbers (except the first four, which are all prime):

As is customary, Pn and Cn denote prime numbers and unfactored composite numbers n digits long.

Applications
use the properties of Sylvester's sequence to define large numbers of Sasakian Einstein manifolds having the differential topology of odd-dimensional spheres or exotic spheres. They show that the number of distinct Sasakian Einstein metrics on a topological sphere of dimension 2n −&thinsp;1 is at least proportional to sn and hence has double exponential growth with n.

As describe,  and  used values derived from Sylvester's sequence to construct lower bound examples for online bin packing algorithms. similarly use the sequence to lower bound the performance of a two-dimensional cutting stock algorithm.

Znám's problem concerns sets of numbers such that each number in the set divides but is not equal to the product of all the other numbers, plus one. Without the inequality requirement, the values in Sylvester's sequence would solve the problem; with that requirement, it has other solutions derived from recurrences similar to the one defining Sylvester's sequence. Solutions to Znám's problem have applications to the classification of surface singularities (Brenton and Hill 1988) and to the theory of nondeterministic finite automata.

describes an application of the closest approximations to one by k-term sums of unit fractions, in lower-bounding the number of divisors of any perfect number, and uses the same property to upper bound the size of certain groups.