Analysis

A sum of factorials that converges at every prime

1 + 1 + 2 + 6 + 24 + 120 + … grows faster than any geometric series and has no sum in the real numbers. Measure size by divisibility instead and the same series converges at every prime at once, to a different number each time. Whether any of those numbers ends in zero is a question Đuro Kurepa asked in 1971, and a search through every prime below 100,000 says no while a coin-toss model says it should have said yes about twice.

Worth reading first: A series that converges to minus one · A series that converges nowhere.

A series that converges to minus one changed the ruler. Under the 2-adic absolute value a number is small when it is divisible by a high power of 2, and the geometric series 1+2+4+8+⋯1 + 2 + 4 + 8 + \cdots, hopeless in the real numbers, converges to exactly −1-1. Its terms shrink because each is divisible by one more 2 than the last. Geometric series are the simplest case of that mechanism, but not the most dramatic.

The factorials grow faster than any geometric series, and 0!+1!+2!+3!+⋯0! + 1! + 2! + 3! + \cdots has no sum in the real numbers by any summation method that respects size. Euler assigned a value to the alternating version, 1−1+2−6+24−⋯1 - 1 + 2 - 6 + 24 - \cdots, by turning it into an integral, and a series that converges nowhere followed that trick through. Without the alternating signs even that fails. But n!n! contains every prime below nn, and contains each of them more and more often as nn grows. Under every pp-adic absolute value the factorials shrink, and the series converges — in the 2-adic numbers, the 3-adic numbers, the 5-adic numbers, at every prime at once.

The sum of all factorials in base 5: digits that stop changing. Partial sums of n! for N = 0 to 21, last 14 base-5 digits; the 5-adic limit ends …13010230042224.
Fig. 1 The partial sums 0!+1!+⋯+N!0! + 1! + \cdots + N! written in base 5, last fourteen digits only. Shaded digits already agree with the bottom row, the sum of the whole series in the 5-adic numbers; they freeze from the right, one more every five terms or so.

Digits that stop changing

The figure shows convergence the way a 5-adic number experiences it. Write each partial sum in base 5. The sums grow — by N=21N = 21 the partial sum has twenty digits — but their last digits stop changing. From N=4N = 4 on the final digit is always 4. From N=9N = 9 the last two are always 24, and from N=14N = 14 the last three are 224. Each later term is divisible by a higher power of 5 than the one before, so adding it can only disturb digits further to the left.

That is what convergence means here. Two numbers are close in the 5-adic sense when they agree in many final base-5 digits, and a sequence converges when, for every kk, its members eventually agree in their last kk digits. The partial sums do exactly that. The limit — the bottom row of the figure, continued forever to the left — is a 5-adic number, ending in …13010230042224\ldots 13010230042224, and it is the sum of all the factorials in the only sense the 5-adic numbers have.

Nothing about 5 was special. Written in base 7, or 2, or 13, the same partial sums freeze from the right in the same way, at different rates and to different digits. One sequence of whole numbers — 1, 2, 4, 10, 34, 154, 874, … — converges in infinitely many different number systems, and in each it converges to something different.

How often a prime divides a factorial

The rate at which the digits freeze is set by a formula Adrien-Marie Legendre gave in 1808. The number of times a prime pp divides n!n! is

vp(n!)=⌊np⌋+⌊np2⌋+⌊np3⌋+⋯=n−sp(n)p−1,v_p(n!) = \left\lfloor \frac{n}{p} \right\rfloor + \left\lfloor \frac{n}{p^2} \right\rfloor + \left\lfloor \frac{n}{p^3} \right\rfloor + \cdots = \frac{n - s_p(n)}{p - 1},

where sp(n)s_p(n) is the sum of the digits of nn written in base pp. The first form counts the multiples of pp up to nn, then the multiples of p2p^2 that contribute an extra factor, and so on. The second form is a rearrangement of the first.

How many times each prime divides n factorial. v₂(64!) = 63, v₃(64!) = 30, v₅(64!) = 14, v₇(64!) = 10.
Fig. 2 The exponent of the highest power of pp dividing n!n! for p=2,3,5,7p = 2, 3, 5, 7 and nn up to 64, beside the line n/(p−1)n/(p - 1). The staircases never fall and climb without bound: 64!64! is divisible by 2632^{63}, 3303^{30}, 5145^{14} and 7107^{10}.

The staircases never fall, and they climb at an average rate of one step per p−1p - 1 terms. So the pp-adic absolute value ∣n!∣p=p−vp(n!)|n!|_p = p^{-v_p(n!)} goes to zero, and for a series of pp-adic numbers that is enough. In the real numbers terms that shrink to zero are necessary for convergence but not sufficient, as the harmonic series shows. In the pp-adic numbers they are sufficient as well, because of the strong triangle inequality: a sum of terms each divisible by pkp^k is itself divisible by pkp^k. A tail can never accumulate into something large.

The staircase also says how the digits in the hero figure freeze. When v5((N+1)!)v_5((N+1)!) reaches kk, every term from (N+1)!(N+1)! on is divisible by 5k5^k, so the partial sum at NN already has its final kk digits. The figure checks that this lower bound holds in every row. In several rows the agreement is longer than the bound guarantees, because a few further digits happen to be right by luck.

One series, a different number at every prime

Computed exactly, by summing far enough that every later term is divisible by p16p^{16}, the limit’s first sixteen digits at eight primes are these.

The sum of all factorials at eight different primes. p = 2: …1111101000011010; p = 3: …0021202011012101; p = 5: …4313010230042224; p = 7: …6314153020161166; p = 11: …6A777971A4A99411; p = 13: …C67ABB8177052A3A; p = 17: …9B3A2BCDD25B9B5D; p = 19: …7369I0D2GIA59HB9.
Fig. 3 The first sixteen digits of 0!+1!+2!+⋯0! + 1! + 2! + \cdots in the pp-adic numbers for the first eight primes, least significant on the right, digits above 9 written as letters. The shaded last digit is 0!+1!+⋯+(p−1)!0! + 1! + \cdots + (p-1)! taken modulo pp.

Each row is a different number in a different field, and there is no known relation among them. It is not known whether any of them is rational. A rational number has an eventually repeating pp-adic expansion, just as it has an eventually repeating decimal expansion, and none of these rows shows a repeat; but sixteen digits prove nothing in either direction. It is expected that the sum is irrational in every pp-adic field. No proof reaches even a single prime.

The shaded column is the start of a sharper question. The last digit of the pp-adic sum is the sum taken modulo pp, and all terms from p!p! on are divisible by pp. So the last digit is

!p=0!+1!+2!+⋯+(p−1)!(modp),!p = 0! + 1! + 2! + \cdots + (p-1)! \pmod p,

the left factorial of pp, introduced by Đuro Kurepa in 1971. For p=2p = 2 it is 0!+1!=20! + 1! = 2, which ends in zero. For every other prime in the figure it does not. A pp-adic number whose last digit is not zero is a unit — it has an inverse among the pp-adic integers — so the question of whether the sum ever ends in zero is whether it is ever divisible by pp.

A neighbour whose sum is known everywhere

The ignorance about these eight rows is specific to this series, and a close relative shows how specific. Multiply each factorial by its own index and sum:

0⋅0!+1⋅1!+2⋅2!+3⋅3!+⋯ .0 \cdot 0! + 1 \cdot 1! + 2 \cdot 2! + 3 \cdot 3! + \cdots.

Since n⋅n!=(n+1)!−n!n \cdot n! = (n+1)! - n!, the partial sums telescope: everything cancels except the last term and the first, and the sum up to NN is exactly (N+1)!−1(N+1)! - 1. In the real numbers that runs off to infinity like the factorials themselves. In every pp-adic field (N+1)!(N+1)! goes to zero, so the sum is −1-1 at every prime at once. It is the same rational number in the 2-adic numbers, the 5-adic numbers and every other, and its digits in base pp are all p−1p - 1, repeating to the left, exactly as −1-1 was in the geometric series.

More generally, any series whose terms are a fixed polynomial in nn times n!n! can be split into a telescoping part and a remainder that is a constant multiple of the plain sum 0!+1!+2!+⋯0! + 1! + 2! + \cdots. So the whole family has pp-adic sums of the form a+b Spa + b\,S_p, with aa and bb rational, where SpS_p is the one unknown number in each field. The plain series is the single irreducible ingredient. Every sum of polynomial-weighted factorials either telescopes to something known or carries a copy of it.

That is also why the plain sum resists. A rational sum would mean some combination of factorials telescopes after all — that Sp=−a/bS_p = -a/b for some rational numbers, the same for every prime or different for each. No telescoping identity of that kind is known, and the digits give no hint of one. Euler’s alternating series, whose real value is the Gompertz constant 0.5963…0.5963\ldots, has the same structure at every prime, and its pp-adic sums are just as unknown.

The contrast also explains what the last digit measures. For the telescoping series the last digit is always p−1p - 1, because −1-1 is a unit and its final digit is p−1p - 1. For the plain series the last digit is the left factorial’s residue, and there is no telescoping to fix it. It could in principle be zero. Wilson’s theorem fixes the residue of a single factorial, (p−1)!≡−1(modp)(p - 1)! \equiv -1 \pmod p. Nothing fixes the residue of their sum.

Kurepa’s question

Kurepa conjectured that for every odd prime pp, the left factorial !p!p is not divisible by pp. His original form was a statement about greatest common divisors — that !n!n and n!n! share no factor but 2 for every n≥2n \ge 2 — and the two forms are equivalent, since a prime pp divides some n!n! together with !n!n exactly when it divides !p!p. In the language of this essay, Kurepa conjectured that the sum of all factorials is a pp-adic unit at every odd prime.

Deciding it for one prime is a finite computation: add up pp factorials modulo pp, which means pp multiplications and pp additions on numbers smaller than pp. For all 9,591 odd primes below 100,000 it takes a few seconds.

Where the left factorial lands for every prime below 100,000. 9591 odd primes; none divides its left factorial; closest: 77687: 77684, 10331: 10329, 33703: 9, 52289: 52275.
Fig. 4 Each of the 9,591 odd primes below 100,000, placed at the height (!p mod p)/p(!p \bmod p)/p. A prime dividing its left factorial would sit on the bottom edge. None does; the circled points are the closest misses above 1,000, such as 77,687 with remainder p−3p - 3 and 10,331 with remainder p−2p - 2.

The cloud fills the square and touches neither edge. No odd prime below 100,000 divides its left factorial. The closest misses are close only in the sense that a remainder of 2 or 3 is small: 10,331 leaves remainder p−2p - 2, 77,687 leaves p−3p - 3, 33,703 leaves 9. Computer searches have since extended the check enormously. Miloš Tatarević and Vladica Andrejić checked every prime below 2342^{34}, about seventeen billion, in 2016, and found none either.

The remainders are as random as remainders can look

The absence of zeros would have an obvious explanation if the remainders avoided zero for some structural reason — if, for instance, they crowded towards the middle or kept to one half. The figures say they do not.

The left factorial's remainders are spread as evenly as chance. Bins: 480, 505, 485, 438, 468, 485, 483, 538, 488, 450, 478, 432, 476, 483, 491, 472, 459, 466, 518, 496; chi-square 24.5.
Fig. 5 The 9,591 primes sorted into twenty equal bins by (!p mod p)/p(!p \bmod p)/p, against the 480 a bin would hold if the remainders were uniform (dashed). The chi-square statistic is 24.5 on nineteen degrees of freedom, an ordinary value for random data.

Every bin holds between 432 and 538 primes, and a chi-square test finds nothing a random spread would not produce. The lowest bin, the one next to zero, holds 480, exactly the average. Nothing in the distribution of the remainders keeps them away from zero, and that is what makes the observation hard. If the remainders behave like random numbers below pp, a prime should divide its left factorial with probability 1/p1/p, and over many primes some should.

A coin that ought to have landed

The coin-toss model is the one the Wieferich essay set out for the family of “second-order” congruences. A theorem guarantees some divisibility, and the next question is a coin with a one-in-pp chance. Here no theorem guarantees anything modulo pp, and the question is the plainest version: does pp divide a number that has no reason to be divisible by it?

Two conjectures and one coin: Wilson primes turn up, Kurepa's never do. Expected count sum 1/p: 1.30 by 100, 1.70 by 1,000, 2.21 by 100,000. Kurepa solutions found: 0. Wilson primes found below 30000: 5, 13, 563.
Fig. 6 If each odd prime divided its left factorial with chance 1/p1/p, the expected number of such primes up to xx would be the sum of 1/p1/p: 1.30 by 100, 1.70 by 1,000, 2.21 by 100,000. None is found. The same expectation applied to Wilson primes, where p2p^2 divides (p−1)!+1(p-1)! + 1, is met: 5, 13 and 563 turn up below 30,000.

The expected count is the sum of 1/p1/p over odd primes, which grows like log⁡log⁡x\log \log x — the slowest-growing divergent sum in common use. Below 100,000 it is 2.21. If the events were independent coins, the chance of seeing none at all would be about e−2.21≈0.11e^{-2.21} \approx 0.11. Extended to seventeen billion the expectation is about 2.9, and the chance of none about 0.050.05.

Set beside the Wilson primes the contrast is pointed. For Wilson’s congruence the same model predicts about two below 100,000, and three are found, at 5, 13 and 563. That fits as well as such a model can, given that small primes, where the coin’s chance is large, contribute most of the expectation. For Kurepa’s, the small primes are exactly where the model expected its hits, and they did not come. !3=1+1+2=4!3 = 1 + 1 + 2 = 4, !5=34!5 = 34, !7=874!7 = 874, !11=4,037,914!11 = 4{,}037{,}914 — none divisible by its prime, against chances of a third, a fifth, a seventh and an eleventh.

A one-in-ten or one-in-twenty outcome is not evidence of structure. It is the kind of thing that happens. But the conjecture is believed for a reason beyond the search, and the search fits the belief better than it fits the model. Whether some arithmetic property of the left factorial keeps it from being divisible by pp — a congruence, an identity, a link to some other sequence — is exactly what nobody has found.

Where a proof has gone wrong

Kurepa’s conjecture has already had one published proof that did not survive. Daniel Barsky and Bénali Benzaghou published an argument in 2004 that went through the Bell numbers, which count the ways of splitting a set into blocks and whose residues modulo pp can be tied to the left factorial. In 2011 they withdrew it themselves, after an error was found. The pattern is common to statements of this shape. A divisibility that fails for no visible reason invites an argument that supplies a reason, and the argument very often turns on an identity that holds modulo pp in a slightly different form from the one needed, or on a step that quietly assumes what is to be shown.

The reformulations are still useful, but for computation rather than proof. Expressing the left factorial through other sequences lets the residues for many primes be computed together rather than one prime at a time, and that is how the searches reached billions. Each reformulation is a different way of computing the same number modulo pp, and in each form the statement is the same: a particular whole number, defined by a sum of pp terms, is never divisible by pp. None of them has supplied the reason.

What the computations cannot settle

Every figure here is a finite computation, and each establishes its finite statement exactly. The hero figure’s digits are correct, the eight limits are correct to sixteen digits, and no odd prime below 100,000 divides its left factorial. None of this bears on irrationality, which needs the infinite expansion, or on Kurepa’s conjecture, which concerns all primes.

The figures also cannot measure independence, and the coin-toss model assumes it. If the events “p divides !p!p” were correlated across primes — if the left factorial’s residues were tied together by an unseen structure — the expected count could be quite different from the sum of 1/p1/p. The evenness test shows that each residue, taken alone, looks random. It does not show that the residues are unrelated to one another, and that is what the model needs.

And the series’ pp-adic sums are drawn here as digit strings, which shows their size and nothing of their arithmetic. A pp-adic number can satisfy a polynomial equation without any visible pattern in its digits. The square roots that Hensel’s lifting builds look exactly as patternless as these rows. So the absence of a repeat in sixteen digits says even less about algebraic relations than it does about rationality.

Still open: whether the sum is ever divisible

Kurepa’s conjecture is open, and so is every question about the sum’s arithmetic: whether it is rational, or algebraic, at any single prime. Whether there are primes at which the pp-adic sums at two different primes are related is not even a well-posed question yet, since they live in different fields.

Two weaker questions are also open. It is not known that infinitely many primes fail to divide their left factorial. That would be a very weak form of the conjecture, and it is not known only because no argument controls the residues for infinitely many primes at once. And the heuristic’s own status is unclear: whether the left factorial’s residues are equidistributed modulo pp in the limit, as the histogram suggests, is itself an unproved statement about a sequence defined by a sum of factorials.

The neighbouring questions in the same family fare no better. Whether there are infinitely many Wilson primes is open, though the model predicts infinitely many. So is whether there are infinitely many primes pp for which (p−1)!(p-1)! has any prescribed residue modulo p2p^2. The structure of factorials modulo prime powers is understood one prime at a time, through results like Granville’s reading of binomial coefficients, and not uniformly across primes.

Convergence as a property of the ruler

The real numbers and the pp-adic numbers disagree completely about this series. In one it diverges violently. In each of the others it converges, with digits that freeze from the right at a rate set by Legendre’s staircase. The sums are infinitely many unrelated numbers, one for each prime, all defined by the same list of whole numbers. That is the point the series that converges to minus one made with powers of 2, now made with a series that shrinks under every prime at once.

The question Kurepa asked turns out to be a question about the last digit of each of those sums. It can be checked one prime at a time with a few seconds of arithmetic, and it has been checked to seventeen billion. It fits no model that treats remainders as random, and no structure has been found that explains it. It is a small, exact statement about a familiar sum. Its truth is in no real doubt, and nobody can prove it.

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.

ConvergenceFactorialHeuristicModular arithmeticP adic numbersPrimes