Number

Numbers that never make a prime

Multiply 78,557 by a power of two and add one. The result is never prime, for any power, though almost every other odd number gives a prime within a few doublings. The reason is that seven small primes take it in turn to divide the result, on a schedule repeating every 36 steps that leaves no step uncovered. Proving nothing smaller does this has taken sixty years of search, and five candidates are still running.
18 min read 7 figures Small cases lieDecided by exhaustion

Worth reading first: Which infinitudes are proved · The sieve that cannot finish.

Many sequences of whole numbers look as if they should contain infinitely many primes, and almost nothing can be proved about any of them. Which infinitudes are proved is a short list. Nobody knows that n2+1n^2 + 1 is prime infinitely often, or that there are infinitely many primes of the form 2n+12^n + 1, and for that one the evidence points the other way. Take the form k⋅2n+1k \cdot 2^n + 1 with kk odd. For a fixed kk, as nn runs through 1, 2, 3, …, the numbers grow quickly, and a number near 2n2^n has about one chance in nln⁡2n \ln 2 of being prime. Since ∑1/n\sum 1/n diverges, a fixed kk might be expected to produce infinitely many primes. For nearly every kk that is what seems to happen.

So it is a real surprise that Wacław Sierpiński proved in 1960 that there are infinitely many odd kk for which k⋅2n+1k \cdot 2^n + 1 is never prime, not for any nn. Such a kk is called a Sierpiński number. The smallest known is 78,557, found by John Selfridge in 1962. Its proof of compositeness has nothing to do with the size of the numbers and it is short enough to draw.

Why 78,557 · 2ⁿ + 1 is never prime. For k=78557: 3 divides when n is 0 mod 2; 5 divides when n is 1 mod 4; 7 divides when n is 1 mod 3; 13 divides when n is 11 mod 12; 19 divides when n is 15 mod 18; 37 divides when n is 27 mod 36; 73 divides when n is 3 mod 9; every exponent covered with period 36.
Fig. 1 Seven primes across the top of a schedule of period 36: a coloured square means that prime divides 78,557⋅2n+178{,}557 \cdot 2^n + 1, and the bottom row shows that every exponent has at least one.

Seven primes on a schedule

Choose a prime pp, and look at k⋅2n+1k \cdot 2^n + 1 modulo pp as nn grows. Since the powers of two go round a cycle modulo pp, of length equal to the order of 2 modulo pp, the values repeat. For k=78,557k = 78{,}557 and p=3p = 3, the order is 2, and 3 divides the number when nn is even. That takes care of half the exponents. For p=5p = 5, the order is 4, and 5 divides it when n≡1(mod4)n \equiv 1 \pmod 4. For p=7p = 7, the order is 3, and 7 divides it when n≡1(mod3)n \equiv 1 \pmod 3. Then 13 when n≡11(mod12)n \equiv 11 \pmod{12}, 19 when n≡15(mod18)n \equiv 15 \pmod{18}, 37 when n≡27(mod36)n \equiv 27 \pmod{36} and 73 when n≡3(mod9)n \equiv 3 \pmod 9.

Those seven conditions, in the seven rows of the figure, cover every whole number nn, as the bottom row shows. Every nn falls in at least one, and the pattern repeats every 36 steps, since 36 is the least common multiple of the orders. So for every nn, the number 78,557⋅2n+178{,}557 \cdot 2^n + 1 has one of those seven primes as a factor, and since the number is larger than 73, it is composite. Every one of infinitely many numbers has a small known factor, identified by nothing more than its exponent modulo 36.

The largest of those seven primes is 73 and the schedule has period 36, so the whole proof is a finite check. There is a second kind of Sierpiński number too, such as 271,129271{,}129, with a different covering.

Why 271,129 · 2ⁿ + 1 is never prime. For k=271129: 3 divides when n is 1 mod 2; 5 divides when n is 0 mod 4; 7 divides when n is 2 mod 3; 13 divides when n is 6 mod 12; 17 divides when n is 6 mod 8; 241 divides when n is 10 mod 24; every exponent covered with period 24.
Fig. 2 A second covering, with six primes and period 24, for k=271,129k = 271{,}129: the shape of the argument is the same with a different schedule.

Six primes are enough here: 3, 5, 7, 13, 17 and 241, with period 24. Given one covering, infinitely many Sierpiński numbers follow at once. If a kk has a covering with primes p1,…,prp_1, \dots, p_r, then any k′k' that is congruent to kk modulo all those primes and modulo 2 has the same covering, and an arithmetic progression of such numbers exists by the Chinese remainder theorem. That is exactly Sierpiński’s proof: choose primes dividing 22j+12^{2^j} + 1 for a set of small jj, and build a covering from their orders. It uses the seven factors of the first few Fermat numbers, and it leads directly to a large explicit example.

Sierpiński’s own example

The original construction shows where such coverings come from, and it uses numbers already familiar for another reason. The Fermat numbers Fj=22j+1F_j = 2^{2^j} + 1 are 3, 5, 17, 257, 65,537, and then F5=641×6,700,417F_5 = 641 \times 6{,}700{,}417. Every whole number nn has a highest power of two dividing it, 2j2^j. If j≤4j \le 4, then 2n≡−12^n \equiv -1 modulo FjF_j. If j=5j = 5 then 2n≡−12^n \equiv -1 modulo 641 as well. If j≥6j \ge 6, then 2n≡12^n \equiv 1 modulo 6,700,417. So the classes by highest power of two make a covering, and every nn belongs to exactly one of them.

So choose kk by the method of several dials: k≡1k \equiv 1 modulo each of 3, 5, 17, 257, 65,537 and 641, and k≡−1k \equiv -1 modulo 6,700,417. Then for each nn, the number k⋅2n+1k \cdot 2^n + 1 is −1+1=0-1 + 1 = 0 modulo one of the seven primes. The smallest such odd kk is a number of 20 digits, about 1.55×10191.55 \times 10^{19}, and a direct test of the seven congruences at every nn to 4,096 confirms the covering. Compared with 78,557 it is enormous. Selfridge’s example shows how much smaller a covering can be when the primes are chosen with care: he uses periods that divide 36 and that overlap efficiently, and not the rigid scheme of powers of two.

It is a pretty coincidence that the failure of the Fermat numbers to stay prime is what makes this construction possible. Euler’s discovery that 641 divides F5F_5, which ended a famous conjecture about those numbers, gives the last two primes that the argument needs. If F5F_5 had been prime the covering would have needed more care: its single large prime would have had to handle the class j=5j = 5, and with no other prime available the class j≥6j \ge 6 would have had nothing left to cover it. It would then have been necessary to continue through the Fermat numbers for ever.

Why most kk are not like this

Most k make a prime almost at once. First prime k 2^n + 1 for odd k below 2000, tested to n = 300: slowest 257 at n=279; none found for 8 values: 47, 383, 881, 1201, 1643, 1699, 1727, 1741.
Fig. 3 Every odd kk below 2,000 with the first exponent giving a prime: most do so within a few steps, and the warning dots along the top have not yet by n=300n = 300.

For almost all kk, nothing resists. The search here tests every odd kk below 2,000 up to n=300n = 300, using strong probable-prime tests, and most values of kk produce a prime immediately. Only 8 of the 1,000 values of kk go past n=300n = 300: 47, 383, 881, 1,201, 1,643, 1,699, 1,727 and 1,741. They are not special. In the published tables, 47 gives a prime at n=583n = 583, and 383 at n=6,393n = 6{,}393, the slowest of all small cases. Among the ones that succeed within the tested range, 257 takes the longest here, at n=279n = 279.

So the distribution of the first prime is very wide, and that is just what a chance model predicts. For a given kk the primes are thinly spread, as the next figure shows, and there are always some kk whose first success comes unusually late. Telling apart a kk that is merely late from one with a hidden obstruction is the whole difficulty.

Primes keep coming, thinly. Exponents n up to 500 with 3 2^n + 1 probably prime: 1, 2, 5, 6, 8, 12, 18, 30, 36, 41, 66, 189, 201, 209, 276, 353, 408, 438; 18 in all.
Fig. 4 The running count of primes in 3⋅2n+13 \cdot 2^n + 1 up to n=500n = 500, on a logarithmic scale in nn: an irregular staircase with a roughly constant slope.

The single sequence with k=3k = 3 gives primes at the exponents 1, 2, 5, 6, 8, 12, 18, 30, 36, 41, 66, 189, 201, 209, 276, 353, 408 and 438. On a logarithmic scale in nn, the staircase has a steady slope with long gaps, such as the jump from 66 to 189. That is the signature of a heuristic count ∑c/n\sum c/n, which grows like ln⁡n\ln n: a Poisson process in the variable ln⁡n\ln n. Each of the classical questions about such forms is similar in that nothing here has been proved. No specific kk is known to give infinitely many primes. The infinitude is in this sense a statistical prediction, of a kind that the patterns primes are allowed to make discusses for other families, where only local obstructions are allowed to stop primes appearing. Hardy and Littlewood’s conjectures and the Bateman–Horn formula have that form, and a covering is a local obstruction spread out over many primes.

Covering systems

The mechanism is more general than this application, and Paul Erdős deserves the credit for it. A covering system is a finite list of arithmetic progressions that together contain every integer. The simplest one with distinct moduli has five members.

A covering system. Congruences 0 mod 2, 0 mod 3, 1 mod 4, 5 mod 6, 7 mod 12 cover the integers; density sum 1.33333.
Fig. 5 Five progressions with different steps, across two periods: every whole number lies in at least one, and this is the smallest example with distinct moduli.

The classes 0 mod 2, 0 mod 3, 1 mod 4, 5 mod 6 and 7 mod 12 cover the integers. Their densities add up to 1/2+1/3+1/4+1/6+1/12=1.3331/2 + 1/3 + 1/4 + 1/6 + 1/12 = 1.333, so there is some overlap, which is unavoidable. It is impossible for a covering with distinct moduli to have density exactly 1, in a short proof with roots of unity that goes back to Mirsky, Newman and others. Erdős invented the idea in 1950 to settle a question of Alphonse de Polignac.

Polignac had guessed in 1849 that every odd number is the sum of a prime and a power of two. He claimed to have checked this up to three million, but 127 is already a counterexample, as subtracting 1, 2, 4, 8, 16, 32 or 64 from it leaves a composite number.

Odd numbers that are not a prime plus a power of two. Odd numbers below 200000 of the form p + 2^n: share by range 10: 0.8000, 100: 0.9800, 1000: 0.9640, 10000: 0.9476, 100000: 0.9321, 200000: 0.9288; exceptions begin 1, 127, 149, 251, 331, 337, 373, 509, 599, 701, 757, 809.
Fig. 6 The share of odd numbers up to each size that are a prime plus a power of two: falling slowly from 0.98, and at 0.929 by 200,000.

Nikolai Romanoff proved in 1934 that a positive proportion of odd numbers do have the form. The computation here gives a share of 0.929 at 200,000. The list of those that do not begins 127, 149, 251, 331, 337, 373, 509, 599, 701, 757, 809. What Erdős proved is that infinitely many do not, and in fact a whole arithmetic progression does not. Build a covering with moduli equal to orders of 2 modulo various primes. Then choose an mm so that, for each power 2n2^n, m−2nm - 2^n is divisible by the prime assigned to nn’s class. So m−2nm - 2^n is composite for every nn, and mm is not a prime plus a power of two. It is the same trick as Sierpiński’s a decade before him, with subtraction in place of multiplication. Ronald Graham used it in 1964 for a third purpose, to find a Fibonacci-like sequence, with coprime starting values, that contains no primes at all. Its starting values have 34 digits each, and they come from a covering by the periods of the Fibonacci numbers modulo primes.

There is also the mirror image of the Sierpiński problem, the Riesel numbers kk with k⋅2n−1k \cdot 2^n - 1 always composite, for which the smallest known is 509,203, and there are numbers called Brier numbers that are both. All of them work through coverings.

If a covering is the only known obstruction, is it possible that no kk below 78,557 has one? That is Selfridge’s conjecture: 78,557 is the smallest Sierpiński number. To prove it, one must show that each smaller odd kk gives at least one prime. For most of them, that was easy. By the 1990s the list of those without a known prime had come down to 17.

The last candidates below 78,557. Odd k below 78557 whose sequences resisted for longest: seven resolved by the Seventeen or Bust search, with n up to 31172165; five remain open; 78557 is covered.
Fig. 7 The sequences that resisted longest: each resolved one has a prime with millions of digits, and five values of kk are still running.

So began a distributed project, called Seventeen or Bust, in 2002. It eliminated eleven of them in five years. The primes it found are among the largest ever known, of the special form a Proth test can decide. Then PrimeGrid continued the search, and in 2016 it found 10,223⋅231,172,165+110{,}223 \cdot 2^{31{,}172{,}165} + 1, a number with about 9.4 million digits, the record for a non-Mersenne prime at the time. Five candidates remain: 21,181, 22,699, 24,737, 55,459 and 67,607. Each has been tested past n=40n = 40 million or so, without success, and chance alone predicts that each will eventually succeed. But the chance model also predicts that it could take many times longer than all the work done so far.

The Proth test used in this search is a good example of how far a special form helps. To prove a number of this size is prime, it is enough to check a single power: a(N−1)/2≡−1(modN)a^{(N-1)/2} \equiv -1 \pmod N. That is the order argument in the Lucas test specialised to numbers where N−1N - 1 is almost entirely a power of two, so nothing has to be factored. That is also why the primes of this form are almost the only numbers of this size for which primality can be proved at all.

What would count as a surprise

Sequences that do have an obstruction are not always covered in this simple way. The statement that every Sierpiński number has a covering has not been proved, and it might not be true. Michael Filaseta and collaborators have studied the possibility of kk for which every term is composite without any covering at all. There is a strange and specific candidate: for a perfect fourth power k=x4k = x^4 and n≡2(mod4)n \equiv 2 \pmod 4, the term is 4y4+14y^4 + 1 with y=x⋅2(n−2)/4y = x \cdot 2^{(n-2)/4}, and this has an algebraic factorisation (2y2+2y+1)(2y2−2y+1)(2y^2 + 2y + 1)(2y^2 - 2y + 1). So a partial covering by small primes on most residues, together with an algebraic factorisation on the rest, can also yield a sequence of only composites, and it would not be a covering in the strict sense. Izotov and others have given specific examples of this kind. Whether anything still stranger can happen is not known.

And nothing has been proved about any of the numbers that do not have a covering. For a given kk such as 3, the theorem that there are infinitely many primes of the form 3⋅2n+13 \cdot 2^n + 1 is beyond any current method. So here is a rather odd situation: the “negative” results are simple and exact, and the “positive” ones are heuristic. The sieve methods discussed in the sieve that cannot finish cannot help, because they work for sequences of positive density, and this sequence is exponentially thin. It is similar to the question in when Euclid’s number is itself prime, where the numbers also grow far too quickly for any method except looking.

What is proved, tested and quoted

The coverings of 78,557 and 271,129 were verified exactly. Both can be checked by hand from the seven or six congruences, and they are complete proofs. The primality tests in the first-prime search are strong probable-prime tests to five bases, so strictly these are probable primes. For these sizes a false positive is extremely unlikely. The first-prime table shows only what happens up to n=300n = 300, and the eight unresolved values were left unresolved here, though published results have settled them. The count for k=3k = 3 agrees with the published list up to the range shown.

The statements about the resolved cases and the remaining five are quoted from the Seventeen or Bust and PrimeGrid projects. Those computations took many years of many computers, and they were not recomputed. The density heuristic is not a theorem. The share of odd numbers of the form p+2np + 2^n is an exact count, up to 200,000. Romanoff’s theorem says only that it stays above a positive constant, and the value of the limit, which has been estimated at about 0.43 or so of all integers, is not settled.

Still open: five numbers, and the covering problem

Is 78,557 the smallest Sierpiński number? Five primes would settle it, and they could be found tomorrow or not in this century. Finding one is purely a matter of machine time, with no room left for clever mathematics, but the time needed grows much faster than any search can keep up with, since each test of a number with nn near 50 million takes days.

The covering systems themselves have provided the more interesting open mathematics recently. Erdős asked in 1950 whether the smallest modulus in a distinct covering can be made as large as desired. For decades constructions pushed it up, reaching 42 by 2014. In 2015 Bob Hough proved that the answer is no: every distinct covering has a least modulus below 101610^{16}. Paul Balister, Béla Bollobás, Robert Morris, Julian Sahasrabudhe and Marius Tiba brought this down to 616,000 in 2018, with a new method. The companion question, whether all the moduli can be odd, posed by Erdős and Selfridge, is still open. Hough and Pace Nielsen showed that a distinct covering must use a modulus divisible by 2 or by 3, but not that it must use an even one. The schedule of the opening figure has both factors in its period, and a negative answer would say that this is no accident.

An obstruction that is a timetable

78,557⋅2n+178{,}557 \cdot 2^n + 1 is composite for every nn because seven primes divide it on a timetable of period 36 that covers every step. That is a finite proof about infinitely many numbers, and it is much the strongest statement known about any such sequence. For a typical kk, all the evidence, from the first few hundred steps to the largest primes yet found, says primes keep appearing, and nothing has ever been proved about that. Five smaller values of kk remain to be resolved.

It is striking how easily a sequence can be proved to contain no primes, and how impossible it has been to show that any sequence of this kind contains infinitely many. The proof of the negative is a table that could be written on a card, and the positive statement is still out of reach of all known methods.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

CongruenceConjectureCoveringExhaustive searchOrder of an elementPrimality testPrimes