Exact counts and sharp growth for OEIS A222759, first comment (12 March 2013): extending Glaisher (1900)
Source paper: Haobo Ma and Wenlin Zhang, version 2, CC BY 4.0. The question comes from T. D. Noe’s first comment on OEIS A222759, dated March 12, 2013.
How large can a remainder be?
Fix a positive integer . For each prime , there are ways to choose objects from objects. Divide that number by and take the least nonnegative remainder, . Call an exception if that remainder is not the integer itself. Write for the set of exception primes and for its size.
Take and . The coefficient has remainder upon division by . Even though and are congruent modulo , the remainder is not . In fact, there is no need to compute the coefficient: the remainder is always between and . If , then must be counted, including at equality.
If , then fits in the remainder range, but that alone does not make it the remainder. For , Glaisher’s congruence supplies the missing fact: is divisible by . So the remainder really is . Two primes need their own calculations. Below , count as an extra exception when leaves remainder or upon division by . Below , count as an extra exception when leaves remainder upon division by .
Count the steps instead of computing the coefficients
From onward both extra conditions disappear. Counting exception primes is then the same as counting prime cubes at most .
The early drop from to shows why this is not always an increasing count. But the third exception first appears at the cube of the third prime, . After that, each new prime cube adds one to the count. Write for the -th prime, starting at . For , there are at least exceptions exactly when . Noe’s condition was : take the cube, then use it as an index in the prime list. For the older sufficient threshold is ; the first value that actually works is .
How many is not the same as how far
OEIS A222760 asks for the least prime from which that prime and every later prime are free of exceptions. This depends on the last exception, not just how many there are. At , the only exception is . Although itself is good, starting at still leaves ahead, so the answer is . For every other input the exceptions are an initial segment of the primes (possibly empty), so the answer is the -st prime.
Follow the remainder range to the first appearance of a third exception.
The remainder-range argument also works modulo and ; in those cases even and need no extra corrections. Do not extrapolate the congruence to higher powers: has remainder , not , modulo for every . This counterexample defeats a uniform congruence, but does not count the exceptions at higher powers.
Exact statements and proofs give the formulas, thresholds, and the scope of the existing Lean proof.
Exact statements and proofs
The statements and arguments below are adapted from Haobo Ma and Wenlin Zhang’s version 2. Throughout, is an integer, is the least nonnegative remainder of modulo , counts primes at most , and is the -th prime.
Let . This is the disjoint union of the primes with , the singleton if and , and the singleton if and . A singleton is omitted when its condition fails. Thus is finite and equals plus the two indicators (one if the condition holds, zero otherwise). Both corrections vanish when .
If , then . If and , the congruence below makes the remainder in the allowed range. For and the differences are and . Divisibility by in the first case is equivalent to ; divisibility by in the second is equivalent to . The extra exceptions occur only below the respective cubes, so none is counted twice. See Section 2 of the paper.
For every positive integer and prime , , including when . This is Glaisher’s 1900 result; see Straub, Section 2.
All the denominators are invertible modulo powers of . Set . Inversion permutes the nonzero residues modulo , so by the sum of squares formula (its denominator is invertible). Pairing with gives . With we have . In the expansion of , terms of degree three and higher in vanish modulo , and the linear and quadratic terms vanish by the two cancellations. Only remains. No division by is needed. See Section 2.
For integers and , if and only if . In particular, Noe’s stronger hypothesis implies the count bound.
Below only and can be exceptions. From onward the exceptions are exactly the primes whose cubes have been reached. The -th such event is for . The first primes lie among , so , and the nested-prime threshold is strictly larger. See Section 3.
Substituting into the correction terms also gives the two small count levels: iff ; iff or .
For every , the A222760 value exists and is the first prime greater than . For it is , but . When , it is .
Every prime after the last exception is good, whereas starting at or before the last exception still encounters it. If the set is empty, start at . At the witnesses are an initial segment of the primes. For they are or . Applying the two tests for leaves as the sole non-initial segment. See Section 3. The case uses the classical Wolstenholme congruence.
For the number of primes with is for and for .
For every odd prime the product above reduces to modulo . Pairing and gives , so the product also reduces to modulo . For , is divisible by . In either case the remainder equals when and is smaller than when . See Section 3 and the second Noe comment’s links to A000720 and A056811.
For positive integers , set . It counts primes with , or primes with exponent at least in . For it also counts integers at most with exactly three positive divisors and gives the maximum size of a pairwise coprime collection of composite integers at most .
For , exactly when ; the zero interval is . As formal power series,
The series for is the right side for plus . For fixed , , and in particular , where means the ratio tends to .
The prime exponent in the least common multiple is the largest with . Exactly the prime squares have three divisors. Every composite at most has a prime factor at most ; pairwise coprimality makes these chosen primes distinct, and the prime squares attain the resulting bound. Consecutive prime powers give the intervals. Each prime power contributes one to every coefficient starting at , hence ; only finitely many primes contribute to any given coefficient. The two finite corrections give the extra cubic terms. Finally, substitute in the prime number theorem and use for . See Section 4 for the original credits for interpretations of A056811 and A000720.
What the Lean proof establishes
The existing Lean proof gives distinct prime exceptions for , , and . It does not show finiteness of the full set, lower the hypothesis to , or prove the converse. The fuller results above have written proofs in the paper. The sharp-threshold formalization request describes the remaining statement without re-requesting the original implication.
Verification ledger
Lean-verified results correspond to frozen declarations in trureturing. Written proofs and open items are listed separately below. The table lists the Lean correspondence; links are fixed to the pinned commit, so they do not drift with upstream changes.
Formal basis: trureturing commit 8a24ea4e79de · the-omega-institute/trureturing
(none)
Written proofs
These results cite DOI sources, book proofs and registered formalization requests. They are not kernel-verified and are excluded from LEAN ✓ counts.
- Theorem 1.1 — Exact cubic exception set · Proof · DOI: 10.5281/zenodo.24405795 · Theorem 1, Section 1 · trureturing-requests#580
- Lemma 1.2 — Glaisher’s congruence · Proof · DOI: 10.5281/zenodo.24405795 · Lemma 2, Section 2 · trureturing-requests#581
- Corollary 1.3 — Sharp growth threshold · Proof · DOI: 10.5281/zenodo.24405795 · Corollary 3, Section 3 · trureturing-requests#582
- Corollary 1.4 — Least eventual good prime · Proof · DOI: 10.5281/zenodo.24405795 · Corollary 4, Section 3 · trureturing-requests#583
- Corollary 1.5 — The two smaller moduli · Proof · DOI: 10.5281/zenodo.24405795 · Corollary 5, Section 3 · trureturing-requests#584
- Corollary 1.6 — Prime-power counting in different forms · Proof · DOI: 10.5281/zenodo.24405795 · Corollary 6, Section 4 · trureturing-requests#585
Open problems and conjectures
The following items are explicitly marked open; the book does not treat them as proved.
(none)