Erdős problem 928 — wave 7t
Access/research date: 2026-07-28 UTC.
Claim labels used throughout:
- (a) elementary-rigorous: proved here from elementary identities, inequalities,
or set inclusions.
- (b) rigorous-modulo-named-theorem: a consequence of a precisely identified
theorem in a checked primary source.
- (c) plausible/structural-unverified: a diagnosis or heuristic, not a theorem.
- (d) computational-only: an exact browser/computer result reproducible by the
supplied checker.
0. Mandatory live-page gate
Verbatim authoritative statement
(d: direct Bright Data browser observation.) I fetched the rendered live page,
the discussion page, and the bibliography pop-ups through the Bright Data browser
path. The live page was last edited 03 April 2026. Its statement is:
> Let $\alpha,\beta\in (0,1)$ and let $P(n)$ denote the largest prime divisor of
> $n$. Does the density of integers $n$ such that $P(n)<n^\alpha$ and
> $P(n+1)<(n+1)^\beta$ exist?
Live sources:
- https://www.erdosproblems.com/928
- https://www.erdosproblems.com/latex/928
- https://www.erdosproblems.com/forum/thread/928
Stop-rule fields
(d: direct live-page observation.)
- Status: OPEN.
- Claimed proofs: 0.
- Currently working on this problem: None.
- Interested in collaborating: None.
- Likes: Agustín_Meza.
- “Looks difficult,” “looks tractable,” “could be formalisable,” and “working on
formalising”: all None.
Thus neither mandatory stop condition fired.
Everything mathematical listed on the live page
**(d: faithful transcription/summary of the live page, not an independent
endorsement.)**
1. Dickman [Di30] is credited with the one-variable density
\(\rho(1/\alpha)\).
2. The page says that infinitude follows from Schinzel [Sc67b], who proved that
infinitely often the largest prime factor of \(n(n+1)\) is at most
\(n^{O(1/\log\log n)}\).
3. Erdős also asked for independence, namely whether the density equals
\(\rho(1/\alpha)\rho(1/\beta)\).
4. Teräväinen [Te18] is credited with the logarithmic-density identity
\(\rho(1/\alpha)\rho(1/\beta)\).
5. Wang [Wa21] is credited with the ordinary-density identity conditional on the
Elliott--Halberstam conjecture for friable integers.
6. The page records Erdős's \(r\)-consecutive-number generalisation with conjectural
density \(\rho(1/\alpha)^r\), and points to problem 370.
The bibliography pop-ups identify the sources as:
- [Er76d] P. Erdős, *Problems and results on number theoretic properties of
consecutive integers and related questions*, Proceedings of the Fifth Manitoba
Conference on Numerical Mathematics (1976), 25--44, MR 422146.
- [Er76e] P. Erdős, Problems and results on consecutive integers, Publ. Math.
Debrecen (1976), 271--282, MR 453671.
- [ErPo78] P. Erdős and C. Pomerance, *On the largest prime factors of \(n\) and
\(n+1\)*, Aequationes Math. (1978), 311--321, MR 480303.
- [Di30] K. Dickman, *On the frequency of numbers containing prime factors of a
certain relative magnitude*, Ark. Mat. Astr. Fys. (1930), 1--14.
- [Sc67b] A. Schinzel, *On two theorems of Gelfond and some of their
applications*, Acta Arith. (1967/68), 177--236, MR 222034.
- [Te18] J. Teräväinen, On binary correlations of multiplicative functions,
Forum Math. Sigma (2018), e10, MR 3820018.
- [Wa21] Z. Wang, *Three conjectures on \(P^+(n)\) and \(P^+(n+1)\) hold under
the Elliott--Halberstam conjecture for friable integers*, J. Number Theory 223
(2021), 1--11, MR 4213695.
Both live comments
(d: the site explicitly says comments are unverified.)
1. DesmondWeisenberg, 24 August 2025, proposes the multi-shift generalisation:
for \(0\leq k_1<\cdots density be \(\prod_i\rho(1/\alpha_i)\)? The comment says this would settle problem 369 and perhaps problem 372. 2. Agustín Meza, 20 August 2025, points to Theorem 1.14 of Teräväinen's paper for the logarithmically averaged result. The site notes that it has been updated to incorporate the comment. There is no claimed proof, partial-solution claim, or current-worker marker hidden in the discussion. The following references were opened and their theorem statements checked. (b) Teräväinen, arXiv:1710.01195, Theorem 1.14, proves the Erdős--Pomerance formula with logarithmic density: https://arxiv.org/abs/1710.01195 This verifies the live page's [Te18] summary. (b) A stronger result, not mentioned on the live page, appears in T. Tao and J. Teräväinen, *The structure of correlations of multiplicative functions at almost all scales, with applications to the Chowla and Elliott conjectures*, arXiv:1809.02518, Algebra & Number Theory 13 (2019), 2103--2150: https://arxiv.org/abs/1809.02518 Remark 3.3, especially equations (50)--(51), proves that there is a set \(\mathcal X_0\subset\mathbb N\) of logarithmic density zero such that, for all rational \(\alpha,\beta\in(0,1)\),1. Primary-source audit and a stronger known partial result
1.1 Logarithmic density
1.2 Ordinary density at almost all scales
\(\alpha,\beta\in(0,1)\):
- The paper uses a diagonal argument over the countable rational pairs.
- For real exponents, squeeze between rational exponents approaching from above
and below and use continuity of \(\rho\).
- Replacing \(n^\beta\) in the second indicator by \((n+1)^\beta\) changes at
most \(O(X^\beta)\) terms. Indeed, if an integer lies in
\([n^\beta,(n+1)^\beta)\), then \(n\) is determined up to \(O(1)\) by that
integer, and there are only \(O(X^\beta)\) possible integers.
Consequently, outside one zero-logarithmic-density set of scales,
\[ \frac1X\#\{n\leq X:P(n)This is close to problem 928 but does not remove the exceptional scales. A set of
scales can have logarithmic density zero and still contain infinitely many
multiplicative intervals on which a density ratio makes fixed-size excursions.
Thus (2) does not imply an ordinary limit over every \(X\).
1.3 Ordinary density for almost every shift
(b) Y. Jiang, G. Lü, and Z. Wang, *Averaged forms of two conjectures of
Erdős and Pomerance, and their applications*, Advances in Mathematics 409
(2022), 108592, DOI 10.1016/j.aim.2022.108592, Theorem 1.4, proves the following
different averaging result. For fixed \(\varepsilon>0\),
\[ \begin{split} \sum_{|h|\leq H}\bigg| &\#\{XThis proves the expected ordinary asymptotic for all but \(o(H)\) shifts in a
growing shift interval. It cannot select the particular shift \(h=1\): one fixed
bad shift contributes only \(O(X)\) to (3), which is swallowed by the permitted
average error.
1.4 Wang's conditional theorem
(b) Wang's paper exists at DOI
https://doi.org/10.1016/j.jnt.2020.12.013 and its abstract and theorem discussion
state the conditional ordinary-density result recorded on the live page. Its input
is an Elliott--Halberstam conjecture for friable integers, providing distribution
far beyond what is currently known unconditionally.
1.5 Current unconditional upper bound
(b) A. Pascadi, *On the exponents of distribution of primes and smooth
numbers*, arXiv:2505.00653v2 (29 June 2025), Corollary 1.6, proves that for every
\(\varepsilon>0\) there is \(C>0\) such that
\[ \#\{n\leq x:P(n),P(n+1)\leq y\} \ll_\varepsilon x\,\rho(u)^{13/8-\varepsilon}, \qquad u=\frac{\log x}{\log y}, \tag{4} \]uniformly for
\[ (\log x)^C\leq y\leq x^{1/C}. \]Primary source:
https://arxiv.org/abs/2505.00653
(a+b: corollary for the live variable threshold.) For every fixed
\(\varepsilon>0\), if \(0<\gamma\leq1/C(\varepsilon)\), then
\[ \#\{n\leq x:P(n)integer \(n\leq x\) is included in that fixed-threshold count. The lower bound
\((\log X)^C\leq X^\gamma\) holds eventually. The constant \(C\) is not made
numerical, so (5) is a genuine uniform regime but not an explicit bound for, say,
\(\gamma=1/100\). The conjectured exponent of \(\rho\) is \(2\), so (4) is an
upper-bound advance, not an asymptotic.
Exact-title, exact-phrase, citation, arXiv, and 2025--2026 searches found no primary
paper that removes the exceptional scales in (2), selects \(h=1\) from (3), or
turns (4) into an asymptotic. This is an honest search miss, not evidence that no
such paper exists.
2. Elementary bounds and an exact reduction
Write
\[ A_{\alpha,\beta}(X)= \#\{2\leq n\leq X:P(n)(a) Dickman's one-variable theorem and
\(|A\cap B|\geq |A|+|B|-X\), \(|A\cap B|\leq\min(|A|,|B|)\), give
\[ \max(0,r_\alpha+r_\beta-1) \leq\liminf_{X\to\infty}\frac{A_{\alpha,\beta}(X)}X \leq\limsup_{X\to\infty}\frac{A_{\alpha,\beta}(X)}X \leq\min(r_\alpha,r_\beta). \tag{6} \]For example, at \(\alpha=\beta=2/3\),
\[ 0.1890697838\ldots\leq\liminf A(X)/X \leq\limsup A(X)/X\leq0.5945348919\ldots, \]while the conjectured value is \(0.3534717377\ldots\). Thus positive lower
density is elementary in a substantial parameter range, but existence is not.
2.2 Exact large-prime-factor reduction for \(\alpha,\beta>1/2\)
(a) Put
\[ U_\gamma(n)=1_{P(n)\geq n^\gamma}. \]For \(1/2<\gamma<1\), Dickman's formula simplifies to
\[ r_\gamma=\rho(1/\gamma)=1+\log\gamma, \qquad \lim_{X\to\infty}\frac1X\sum_{n\leq X}U_\gamma(n)=-\log\gamma. \tag{7} \]Inclusion--exclusion shows that the existence of the density in problem 928 is
equivalent, in this regime, to existence of
\[ \lim_{X\to\infty}\frac{C_{\alpha,\beta}(X)}X, \qquad C_{\alpha,\beta}(X)= \sum_{2\leq n\leq X}U_\alpha(n)U_\beta(n+1). \tag{8} \]The independence prediction is exactly
\[ C_{\alpha,\beta}(X) =(\log\alpha)(\log\beta)X+o(X). \tag{9} \]There is also a multiplicity-free prime-equation form. If
\(P(n)=p\geq n^\alpha\) and \(n=ap\), then
\[ a\leq n^{1-\alpha}\(n+1=bq\). Hence (8) is exactly
\[ \begin{split} C_{\alpha,\beta}(X)=\#\{(a,b,p,q):\;&p,q\ {\rm prime},\ 2\leq ap\leq X,\\ &bq-ap=1,\quad p\geq(ap)^\alpha,\quad q\geq(bq)^\beta\}. \end{split} \tag{10} \]Thus, already for \(\alpha,\beta>1/2\), the exact missing all-scales lemma is
\[ \boxed{\ \#\{(a,b,p,q)\text{ satisfying (10)}\} -(\log\alpha)(\log\beta)X=o(X) \quad\text{for every }X\to\infty.\ } \tag{11} \]Tao--Teräväinen supplies (11) outside a zero-log-density set of \(X\)'s. Jiang--Lü--Wang
supplies an averaged-shift analogue. Wang obtains it from a friable
Elliott--Halberstam hypothesis. None supplies (11) at every scale for shift \(1\).
This is the precise analytic wall rather than a vague appeal to “independence.”
3. Exact finite census
3.1 What was computed
(d) For rational \(\gamma=a/b\), the strict inequality was evaluated using
integers only:
\[ P(n)1. constructs every \(P(n)\) through \(10^7+1\) by overwriting multiples of
increasing primes;
2. independently reconstructs every \(P(n)\) using a smallest-prime-factor sieve
and the recurrence
\(P(n)=\max(\operatorname{spf}(n),P(n/\operatorname{spf}(n)))\);
3. checks \(P(n)\) a third way by trial division for \(1\leq n\leq20000\);
4. checks hard-coded exact joint and marginal counts.
All checks passed. The final run used Python 3 standard library only, took 28.952
seconds, and peaked at roughly 130 MiB.
3.2 Exact counts
Each entry is the number of \(n\) with \(2\leq n\leq X\) satisfying the two
strict live-page inequalities.
| \(X\) | \((1/3,1/3)\) | \((1/3,1/2)\) | \((1/2,1/3)\) | \((1/2,1/2)\) | \((1/2,2/3)\) | \((2/3,1/2)\) | \((2/3,2/3)\) |
|---:|---:|---:|---:|---:|---:|---:|---:|
| \(10^3\) | 0 | 10 | 12 | 36 | 114 | 110 | 242 |
| \(10^4\) | 8 | 86 | 99 | 492 | 1,226 | 1,204 | 2,663 |
| \(10^5\) | 86 | 891 | 926 | 5,765 | 13,198 | 13,182 | 28,225 |
| \(10^6\) | 1,053 | 9,208 | 9,347 | 63,102 | 138,909 | 139,020 | 294,981 |
| \(10^7\) | 11,617 | 96,970 | 97,497 | 675,882 | 1,451,554 | 1,451,271 | 3,040,588 |
At \(X=10^7\), let \(J\) be the joint count, \(L\) and \(R\) the two finite
marginal counts on the common \(X-1\)-element sample, and define the
finite-marginal independence ratio \(J(X-1)/(LR)\). The exact marginal counts
for exponents \(1/3,1/2,2/3\) are respectively
\[ 437056,\qquad2719287,\qquad5571397 \]on both sides for this endpoint.
| \((\alpha,\beta)\) | \(J/X\) | \(J(X-1)/(LR)\) | \(\rho(1/\alpha)\rho(1/\beta)\) |
|---:|---:|---:|---:|
| \((1/3,1/3)\) | 0.001161700000 | 0.608162689029 | 0.002362775412 |
| \((1/3,1/2)\) | 0.009697000000 | 0.815915566645 | 0.014915620996 |
| \((1/2,1/3)\) | 0.009749700000 | 0.820349798919 | 0.014915620996 |
| \((1/2,1/2)\) | 0.067588200000 | 0.914030618552 | 0.094158652798 |
| \((1/2,2/3)\) | 0.145155400000 | 0.958106973096 | 0.182434707832 |
| \((2/3,1/2)\) | 0.145127100000 | 0.957920177239 | 0.182434707832 |
| \((2/3,2/3)\) | 0.304058800000 | 0.979556118706 | 0.353471737677 |
These figures are exact counts followed by displayed decimal evaluations. They do
not establish monotonicity, convergence, or a counterexample. In particular,
convergence of even the one-variable smooth-number density is slow at these
sizes.
3.3 Computational ceiling
(c) The present method is \(O(X\log\log X)\) time and \(O(X)\) memory. A
literal Python extrapolation to \(10^9\) is about one core-hour and over 12 GiB;
a segmented compiled implementation would reduce memory and constants but still
only produce another finite prefix. No finite cutoff can remove the exceptional
scales in (2) or prove the uniform \(o(X)\) statement (11). The needed advance is
analytic, not a larger census.
4. Reproduction
Run:
python3 runs/erdos928_wave7t_reverify.py
Expected final lines include:
independent trial-division prefix 1..20000: OK
large-factor inclusion-exclusion/prime-quadruple prefix audit: OK
independent full smallest-factor reconstruction: OK
ALL CHECKS PASSED
The complete standalone source is in runs/erdos928_wave7t_reverify.py and is
reproduced below.
#!/usr/bin/env python3
"""
From-scratch exact finite verifier for Erdős problem 928.
For rational gamma=a/b the live problem's strict condition
P(n) < n**gamma
is tested without floating point as
P(n)**b < n**a.
The program builds the largest-prime-factor table by an Eratosthenes sieve,
checks the entire table against an independent smallest-prime-factor sieve
and recurrence, checks a prefix a third way by trial division, counts seven
(alpha,beta) pairs at the advertised cutoffs, and verifies the hard-coded
exact census.
Only the Python standard library is used.
Default cost (limit 10^7): about 130 MiB peak RAM and roughly half a minute on
the exe.dev VM used for the report. A smaller exploratory run is available
with --limit, but the advertised-census assertions run only at covered
cutoffs.
"""
from __future__ import annotations
import argparse
from array import array
from dataclasses import dataclass
import gc
from math import log
from time import perf_counter
@dataclass(frozen=True, order=True)
class Exponent:
numerator: int
denominator: int
def label(self) -> str:
return f"{self.numerator}/{self.denominator}"
ONE_THIRD = Exponent(1, 3)
ONE_HALF = Exponent(1, 2)
TWO_THIRDS = Exponent(2, 3)
EXPONENTS = (ONE_THIRD, ONE_HALF, TWO_THIRDS)
PAIRS = (
(ONE_THIRD, ONE_THIRD),
(ONE_THIRD, ONE_HALF),
(ONE_HALF, ONE_THIRD),
(ONE_HALF, ONE_HALF),
(ONE_HALF, TWO_THIRDS),
(TWO_THIRDS, ONE_HALF),
(TWO_THIRDS, TWO_THIRDS),
)
DEFAULT_CHECKPOINTS = (10**3, 10**4, 10**5, 10**6, 10**7)
# Filled from one run and then checked by every fresh run. These are counts
# of n with 2 <= n <= X satisfying both strict inequalities.
EXPECTED_COUNTS: dict[int, tuple[int, ...]] = {
# X: counts in the order PAIRS above
10**3: (0, 10, 12, 36, 114, 110, 242),
10**4: (8, 86, 99, 492, 1226, 1204, 2663),
10**5: (86, 891, 926, 5765, 13198, 13182, 28225),
10**6: (1053, 9208, 9347, 63102, 138909, 139020, 294981),
10**7: (
11617, 96970, 97497, 675882, 1451554, 1451271, 3040588
),
}
# At X=10^7, counts on the common sample 2 <= n <= X of the left
# condition at n and the right condition at n+1, in EXPONENTS order.
EXPECTED_FINAL_LEFT = (437056, 2719287, 5571397)
EXPECTED_FINAL_RIGHT = (437056, 2719287, 5571397)
def largest_prime_factors(limit: int) -> array:
"""Return P(n) for 0 <= n <= limit, with the harmless convention P(1)=1."""
lpf = array("I", [0]) * (limit + 1)
if limit >= 1:
lpf[1] = 1
for prime in range(2, limit + 1):
if lpf[prime] == 0:
# Primes are visited in increasing order, so the final divisor
# assigned to each integer is exactly its largest prime divisor.
for multiple in range(prime, limit + 1, prime):
lpf[multiple] = prime
return lpf
def largest_prime_factor_trial(n: int) -> int:
"""Independent trial-division implementation, used only on a prefix."""
if n == 1:
return 1
remaining = n
answer = 1
divisor = 2
while divisor * divisor <= remaining:
while remaining % divisor == 0:
answer = divisor
remaining //= divisor
divisor = 3 if divisor == 2 else divisor + 2
if remaining > 1:
answer = remaining
return answer
def independent_full_lpf_check(reference: array) -> None:
"""
Recompute every P(n) by a structurally different method.
First find the smallest prime factor by marking only previously-unmarked
composites starting at p^2. Then use
P(n) = max(spf(n), P(n / spf(n)))
in increasing n order. This does not reuse the prime list or the
overwriting-by-increasing-primes logic of largest_prime_factors().
"""
limit = len(reference) - 1
spf = array("I", [0]) * (limit + 1)
for prime in range(2, limit + 1):
if spf[prime] == 0:
spf[prime] = prime
if prime * prime <= limit:
for multiple in range(prime * prime, limit + 1, prime):
if spf[multiple] == 0:
spf[multiple] = prime
alternative = array("I", [0]) * (limit + 1)
if limit >= 1:
alternative[1] = 1
for n in range(2, limit + 1):
smallest = spf[n]
cofactor_lpf = alternative[n // smallest]
alternative[n] = (
smallest if smallest > cofactor_lpf else cofactor_lpf
)
for n, (first, second) in enumerate(zip(reference, alternative)):
assert first == second, (n, first, second)
def smooth_exact(prime_factor: int, n: int, exponent: Exponent) -> bool:
"""Integer-only form of prime_factor < n**(numerator/denominator)."""
return (
prime_factor ** exponent.denominator
< n ** exponent.numerator
)
def build_flags(lpf: array, limit: int) -> dict[Exponent, bytearray]:
flags = {exponent: bytearray(limit + 1) for exponent in {
exponent for pair in PAIRS for exponent in pair
}}
for n in range(2, limit + 1):
prime_factor = lpf[n]
flags[ONE_THIRD][n] = prime_factor**3 < n
flags[ONE_HALF][n] = prime_factor**2 < n
flags[TWO_THIRDS][n] = prime_factor**3 < n**2
return flags
def exact_census(
flags: dict[Exponent, bytearray],
checkpoints: tuple[int, ...],
) -> tuple[
dict[int, tuple[int, ...]],
dict[int, tuple[int, ...]],
dict[int, tuple[int, ...]],
]:
running_joint = [0] * len(PAIRS)
running_left = [0] * len(EXPONENTS)
running_right = [0] * len(EXPONENTS)
joint_result: dict[int, tuple[int, ...]] = {}
left_result: dict[int, tuple[int, ...]] = {}
right_result: dict[int, tuple[int, ...]] = {}
checkpoint_set = set(checkpoints)
last = checkpoints[-1]
third = flags[ONE_THIRD]
half = flags[ONE_HALF]
two_thirds = flags[TWO_THIRDS]
for n in range(2, last + 1):
left_third, left_half, left_two_thirds = (
third[n], half[n], two_thirds[n]
)
right_third, right_half, right_two_thirds = (
third[n + 1], half[n + 1], two_thirds[n + 1]
)
running_left[0] += left_third
running_left[1] += left_half
running_left[2] += left_two_thirds
running_right[0] += right_third
running_right[1] += right_half
running_right[2] += right_two_thirds
running_joint[0] += left_third & right_third
running_joint[1] += left_third & right_half
running_joint[2] += left_half & right_third
running_joint[3] += left_half & right_half
running_joint[4] += left_half & right_two_thirds
running_joint[5] += left_two_thirds & right_half
running_joint[6] += left_two_thirds & right_two_thirds
if n in checkpoint_set:
joint_result[n] = tuple(running_joint)
left_result[n] = tuple(running_left)
right_result[n] = tuple(running_right)
return joint_result, left_result, right_result
def rho_for_used_exponents(exponent: Exponent) -> float:
"""
Dickman rho at u=1/gamma for gamma in {1/2,2/3,1/3}.
For 1 <= u <= 2, rho(u)=1-log(u). At u=3, numerical integration
of rho'(u)=-rho(u-1)/u gives the displayed value. Composite Simpson
with 2^18 panels is deterministic and far more accurate than the table
precision used in the report.
"""
u = exponent.denominator / exponent.numerator
if u <= 2:
return 1.0 - log(u)
assert u == 3
panels = 1 << 18
step = 1.0 / panels
def integrand(t: float) -> float:
return (1.0 - log(t - 1.0)) / t
total = integrand(2.0) + integrand(3.0)
total += 4.0 * sum(integrand(2.0 + j * step)
for j in range(1, panels, 2))
total += 2.0 * sum(integrand(2.0 + j * step)
for j in range(2, panels, 2))
integral = total * step / 3.0
return 1.0 - log(2.0) - integral
def verify_prefix(lpf: array, flags: dict[Exponent, bytearray], prefix: int) -> None:
for n in range(1, prefix + 1):
trial = largest_prime_factor_trial(n)
assert lpf[n] == trial, (n, lpf[n], trial)
if n >= 2:
for exponent in (ONE_THIRD, ONE_HALF, TWO_THIRDS):
assert bool(flags[exponent][n]) == smooth_exact(
trial, n, exponent
)
def verify_large_factor_reduction_prefix(
lpf: array,
flags: dict[Exponent, bytearray],
prefix: int,
) -> None:
"""Exhaustively audit the exact Section 2.2 reduction for gamma=2/3."""
smooth = flags[TWO_THIRDS]
live_joint = 0
bad_left_count = 0
bad_right_count = 0
bad_joint = 0
quadruples = 0
for n in range(2, prefix + 1):
bad_left = not smooth[n]
bad_right = not smooth[n + 1]
live_joint += smooth[n] & smooth[n + 1]
bad_left_count += bad_left
bad_right_count += bad_right
bad_joint += bad_left & bad_right
if bad_left and bad_right:
p, q = lpf[n], lpf[n + 1]
a, b = n // p, (n + 1) // q
assert a * p == n and b * q == n + 1
assert b * q - a * p == 1
assert p**3 >= n**2 and q**3 >= (n + 1) ** 2
assert a < p and b < q
quadruples += 1
sample_size = prefix - 1
assert live_joint == (
sample_size - bad_left_count - bad_right_count + bad_joint
)
assert quadruples == bad_joint
def main() -> None:
parser = argparse.ArgumentParser()
parser.add_argument("--limit", type=int, default=10**7)
parser.add_argument("--trial-prefix", type=int, default=20_000)
parser.add_argument(
"--skip-full-cross-check",
action="store_true",
help="skip the independent all-n smallest-factor reconstruction",
)
args = parser.parse_args()
if args.limit < 2:
raise SystemExit("--limit must be at least 2")
checkpoints = tuple(x for x in DEFAULT_CHECKPOINTS if x <= args.limit)
if not checkpoints or checkpoints[-1] != args.limit:
checkpoints += (args.limit,)
started = perf_counter()
lpf = largest_prime_factors(args.limit + 1)
sieve_done = perf_counter()
if not args.skip_full_cross_check:
independent_full_lpf_check(lpf)
gc.collect()
full_check_done = perf_counter()
flags = build_flags(lpf, args.limit + 1)
flags_done = perf_counter()
verify_prefix(lpf, flags, min(args.trial_prefix, args.limit + 1))
verify_large_factor_reduction_prefix(
lpf, flags, min(args.trial_prefix, args.limit)
)
prefix_done = perf_counter()
counts, left_counts, right_counts = exact_census(flags, checkpoints)
census_done = perf_counter()
for cutoff, expected in EXPECTED_COUNTS.items():
if cutoff in counts:
assert counts[cutoff] == expected, (
cutoff, counts[cutoff], expected
)
if args.limit == 10**7 and EXPECTED_FINAL_LEFT:
assert left_counts[args.limit] == EXPECTED_FINAL_LEFT
assert right_counts[args.limit] == EXPECTED_FINAL_RIGHT
print("pair order:", " ".join(
f"({alpha.label()},{beta.label()})" for alpha, beta in PAIRS
))
print("exact counts (2 <= n <= X):")
for cutoff in checkpoints:
row = counts[cutoff]
print(f"X={cutoff}: " + " ".join(map(str, row)))
print("densities count/X at final X:")
final_counts = counts[args.limit]
for (alpha, beta), count in zip(PAIRS, final_counts):
rho_product = (
rho_for_used_exponents(alpha) * rho_for_used_exponents(beta)
)
print(
f" ({alpha.label()},{beta.label()}): "
f"{count / args.limit:.12f} "
f"rho-product={rho_product:.12f} "
f"difference={count / args.limit - rho_product:+.12f}"
)
print("finite-sample independence ratios at final X:")
sample_size = args.limit - 1
exponent_index = {exponent: i for i, exponent in enumerate(EXPONENTS)}
for (alpha, beta), joint in zip(PAIRS, final_counts):
left = left_counts[args.limit][exponent_index[alpha]]
right = right_counts[args.limit][exponent_index[beta]]
ratio = joint * sample_size / (left * right)
residual = joint * sample_size - left * right
print(
f" ({alpha.label()},{beta.label()}): "
f"left={left} right={right} joint={joint} "
f"ratio={ratio:.12f} residual={residual}"
)
print(
f"independent trial-division prefix 1.."
f"{min(args.trial_prefix, args.limit + 1)}: OK"
)
print(
"large-factor inclusion-exclusion/prime-quadruple prefix audit: OK"
)
print(
"independent full smallest-factor reconstruction: "
f"{'SKIPPED' if args.skip_full_cross_check else 'OK'}"
)
print(
"timings seconds: "
f"sieve={sieve_done-started:.3f} "
f"full-check={full_check_done-sieve_done:.3f} "
f"flags={flags_done-full_check_done:.3f} "
f"prefix={prefix_done-flags_done:.3f} "
f"census={census_done-prefix_done:.3f} "
f"total={census_done-started:.3f}"
)
print("ALL CHECKS PASSED")
if __name__ == "__main__":
main()
PARTIAL: Tao--Teräväinen gives the predicted ordinary density outside a zero-log-density set of scales; the supplied independently checked census is exact through 10^7, and the remaining fixed-shift all-scales task is precisely the prime-quadruple discrepancy (11).