Number of Totients: How OpenAI’s Proof Counts Euler’s Distinct Outputs

Euler’s totient function sends both 8 and 12 to 4. Computing either output is easy. Counting every distinct output, without counting 4 twice, leads to a question that has resisted precise asymptotics for decades. OpenAI’s September 25, 2026 manuscript gives an asymptotic formula for the number of totients, together with the Erdős–Hall scaling result: multiplying a sufficiently large cutoff by any fixed positive factor multiplies the count asymptotically by that factor.

The coefficient is not a newly discovered decimal constant. It retains arithmetic information through a convergent construction. The research manuscript explains how prime-factor geometry and careful duplicate removal produce that coefficient. Released through OpenAI’s mathematics initiative, this is a number-theoretic proof, not a measured improvement in a factoring program.

1. What Is the Number of Totients, and What Does V(x) Count?

Number of totients example maps inputs 8 and 12 to 4, and inputs 20 and 24 to 8.
Number of totients example maps inputs 8 and 12 to 4, and inputs 20 and 24 to 8.

Euler’s totient φ(n)\varphi(n) counts integers from 1 through nn that are coprime to nn, meaning their greatest common divisor with nn is one. For 8, these are 1, 3, 5, and 7. Thus φ(8)=φ(12)=4\varphi(8)=\varphi(12)=4.

The totient counting function records the range of this arithmetic function:

V(x)=#{v≤x:∃n≥1, φ(n)=v}.V(x)=\#\{v\le x:\exists n\ge1,\ \varphi(n)=v\}.

Here #\# means the number of elements, and inputs are positive integers. The cutoff bounds the output, not its preimage. Simply evaluating inputs up to xx need not find every output below xx.

Number of Totients: Key Facts
TopicWhat It Means
Counted objectDistinct positive outputs of Euler’s totient function, each counted once.
Duplicate exampleφ(8)=φ(12)=4\varphi(8)=\varphi(12)=4: two preimages contribute one output.
Main advanceAn asymptotic equivalent and fixed-dilation limits for every fixed positive multiplier.
CoefficientA positive, bounded phase-dependent function, defined independently of the count.
Practical scopeA theorem about eventual growth, without a tested fast enumeration algorithm.

The same distinction between representations and outputs appears in our inverse Goldbach explainer: several input pairs can generate one integer. A counting argument must decide which object receives the tick mark.

2. The Original Counting Problem: What Erdős and Hall Wanted to Know

Totient values have natural density zero: V(x)/x→0V(x)/x\to0. Their share of the positive integers eventually vanishes. This does not mean there are only finitely many. Every prime pp supplies the distinct totient p−1p-1, already giving roughly x/logxx/\log x values up to xx.

In 1976, Erdős and Hall asked whether V(cx)/V(x)→cV(cx)/V(x)\to c for fixed c>1c>1. Does doubling a large interval approximately double its supply of totients, despite their thinning density? That is compatible with zero density, just as the prime count has nearly linear growth over fixed multiplicative changes while primes become proportionally rarer.

As our Artin primitive-root analysis also illustrates, infinitude, density, and a precise growth law are different conclusions. Here the new limit specifies behavior across fixed multiplicative intervals.

Erdős Problem 416 brings together this scaling question and the search for an asymptotic formula. These concern distinct totient values, not an algorithm for evaluating one totient. Our short Egyptian fractions article covers another Erdős question where the exact quantitative target matters.

3. What Earlier Mathematics Established, and Why Ford’s Estimate Wasn’t Enough

The distribution of totients became progressively clearer through work by Pillai, Erdős, Erdős–Hall, Pomerance, and Maier–Pomerance. The progression concerns increasingly precise population estimates.

From Zero Density to an Asymptotic Equivalent
TopicWhat It Means
Pillai, 1929Established that totient values occupy a vanishing proportion of integers.
Erdős, 1935Sharpened the upper bound to almost the reciprocal-logarithmic scale.
Erdős–Hall, 1976Strengthened lower bounds and posed the fixed-dilation question.
Maier–Pomerance, 1988Determined the leading constant in the squared triple-logarithmic exponent.
Ford, 1998Determined the order up to bounded multiplicative uncertainty, with structural estimates for typical preimages.

Ford’s 1998 distribution theorem, using its revised 2013 version, gives the following expression. All logarithms are natural, and logjx\log_j x means applying the logarithm jj times.

V(x)=xlog⁡xexp⁡{C0(log3⁡x−log4⁡x)2+D0log3⁡x−(D0+12−2C0)log4⁡x+O(1)}.\begin{array}{rl}V(x)&=\frac{x}{\log x}\exp\{\,C_0(\log_3x-\log_4x)^2\\&\quad+D_0\log_3x\\&\quad-(D_0+\tfrac12-2C_0)\log_4x+O(1)\,\}.\end{array}

The constants are C0=0.8178146…C_0=0.8178146\ldots and D0=2.1769687…D_0=2.1769687\ldots. The notation O(1)O(1) denotes a bounded quantity. Exponentiating it leaves a bounded multiplicative factor, which need not approach one or cancel between endpoints.

An asymptotic equivalent is stronger: the true count divided by its proposed main term tends to one. The difference resembles the distinction between frequency and isolated examples in large prime gaps. More detail about abundance can answer a different mathematical question.

4. OpenAI’s Asymptotic Formula: Theorem 2.1 Explained

The new asymptotic formula for the number of totients is:

V(x)∼xlog⁡xGmA(1;θ).V(x)\sim\frac{x}{\log x}G_mA(1;\theta).

The symbol ~\sim means ratio tending to one as x→∞x\to\infty. To define the scale, first set aj=(j+1)log(j+1)−jlogj−1a_j=(j+1)\log(j+1)-j\log j-1 for j≥1j\ge1. These positive coefficients determine the unique root ρ∈(0,1)\rho\in(0,1) satisfying:

∑j≥1ajρj=1.\sum_{j\ge1}a_j\rho^j=1.

Set λ=log(1/ρ)\lambda=\log(1/\rho) and γ=(∑j≥1jajρj)−1\gamma=(\sum_{j\ge1}ja_j\rho^j)^{-1}. This γ\gamma is not Euler’s constant. The recurrence starts with g0=1g_0=1:

gj=∑d=1jadgj−d.g_j=\sum_{d=1}^{j}a_dg_{j-d}.

For sufficiently large xx, the remaining definitions are:

B=log⁡log⁡x,q=log⁡B−log⁡log⁡Bλ,m=⌊q⌋,θ=q−m,Gj=Bjj!∏i=1jgi(0≤j≤m).\begin{array}{rl}B&=\log\log x,\\q&=\frac{\log B-\log\log B}{\lambda},\\m&=\lfloor q\rfloor,\qquad\theta=q-m,\\G_j&=\frac{B^j}{j!\prod_{i=1}^{j}g_i}\quad(0\le j\le m).\end{array}

The auxiliary qq only abbreviates the displayed quotient. Thus θ∈[0,1)\theta\in[0,1) is its fractional part, and empty products give G0=1G_0=1. The earlier constants satisfy C0=1/(2λ)C_0=1/(2\lambda) and D0=(1+log(λ/γ))/λ−1/2D_0=(1+\log(\lambda/\gamma))/\lambda-1/2.

The coefficient A(1;θ)A(1;\theta) is bounded above and bounded away from zero uniformly in phase. Its first argument is the constant weight one. “Explicit” means independently defined arithmetic approximations, not an elementary closed form or a ready numerical calculator.

5. The Prime-Factor Decomposition Behind the Proof

Number of totients proof separates a long prime prefix from an exact arithmetic tail at two distinct cuts.
Number of totients proof separates a long prime prefix from an exact arithmetic tail at two distinct cuts.

Order the prime factors of a typical preimage from largest to smallest and write:

n=p0p1⋯pLa.n=p_0p_1\cdots p_La.

Two cuts separate the parts: R=m−HR=m-H and L=m−PL=m-P, where P=⌊loglogH⌋P=\lfloor\log\log H\rfloor. The parameter HH is fixed while xx tends to infinity, then allowed to grow. Reversing those limits would invalidate the finite-tail argument.

1. Largest Prime
p0p_0
Count by the prime number theorem.
2. Remaining Continuous Prefix
p1,…,pRp_1,\ldots,p_R
Replace weighted prime sums by volume.

Cut at R: keep the later factors discrete

3. Exact Arithmetic Tail
pR+1,…,pLp_{R+1},\ldots,p_L and aa
Combine witnesses with the same totient.
Schematic of the two cuts. L ends the retained prime list; the cofactor a follows it. Solid teal marks the prefix. Double amber marks the discrete tail.

The long prefix ends at pRp_R. Its primes become large enough for continuous approximations. The remaining primes and smooth cofactor aa form the arithmetic tail. “Smooth” means all prime divisors lie below a specified bound.

For fixed HH, the tail is bounded independently of xx. Ford’s structure estimates discard a small exceptional collection of values. Crucially, outside that collection, every preimage has the required structure. Finding only one convenient preimage would not later justify conclusions about the least one.

Prime-factor organization also drives our Erdős–Pomerance explainer, although its target is a joint distribution for consecutive integers rather than the range of the totient function.

6. How Simplex Geometry Turns Prime Factors Into a Counting Formula

The useful coordinates are ui=loglogpiu_i=\log\log p_i, with u0=Bu_0=B. They compress enormously separated prime sizes into a manageable geometric region. Weighted inequalities constrain later coordinates relative to earlier ones.

For the true simplex in jj coordinates, define nonnegative slacks si=ui−∑r=i+1jar−iurs_i=u_i-\sum_{r=i+1}^{j}a_{r-i}u_r. A slack measures room left in an inequality. The recurrence gives:

∑i=0jgisi=B.\sum_{i=0}^{j}g_is_i=B.

After rescaling to Wi=gisi/BW_i=g_is_i/B, the slacks are nonnegative and sum to one. This is a standard simplex, whose original-coordinate volume is precisely GjG_j.

A two-dimensional normalized slack simplexHorizontal W one and vertical W two axes both run from zero to one with equal visual unit lengths. The filled right triangle has vertices zero zero, one zero, and zero one. Its diagonal is W one plus W two equals one. The interior also allows a nonnegative residual W zero.011W₁W₂W₁ + W₂ = 1Allowed slacks
Exact two-dimensional normalized example: the filled triangle is W1≥0W_1\ge0, W2≥0W_2\ge0, W1+W2≤1W_1+W_2\le1. The residual is W0=1−W1−W2W_0=1-W_1-W_2. The proof uses higher-dimensional simplexes, not this triangle’s area.

Prime sums become volumes because reciprocal shifted-prime weights, 1/(p−1)1/(p-1), have approximately unit mass in suitable unit boxes of double-logarithmic coordinates. Mertens’ theorem supplies that conversion. Concentration bounds show that boundary strips and unusually positioned coordinates contribute little.

Smooth-cofactor estimates then control the residual integer rather than silently discarding it. The normalized triangle makes the role of a slack concrete: moving toward its diagonal consumes the residual coordinate, while crossing the diagonal would make that coordinate negative and therefore inadmissible.

The resulting volume counts weighted prime configurations. It still needs an arithmetic argument to count distinct outputs. As in our complete-graph crossing-number explainer, geometry is an intermediate language whose connection to the original counting target must be justified.

7. The Shifted-Prime Sieve: Why Different Prefixes Rarely Produce the Same Totient

Distinct prefixes might yield the same product of shifted primes. For a good representation with tail totient dd, the value is:

v=d∏i=0R(pi−1).v=d\prod_{i=0}^{R}(p_i-1).

Compare two representations and cancel their common prefix. At the first unequal prime, the remaining equality constrains two products of shifted primes. The proof aligns their large factors and compares them in layers.

Each sieve application involves only two or three linear forms, even though the number of layers grows. Upper bounds limit how often the simultaneous primality requirements can occur. The argument also accounts for recovering hidden tuple data from residual factors.

This last bookkeeping matters: bounding the number of collision values alone is insufficient if one value supports many tuples. The paper bounds ordered pairs of distinct tuples with the same output, on a scale negligible relative to the main count after the prescribed limits.

Consequently, almost every counted value has a unique long prefix. This does not imply a unique complete preimage. Nor does the sieve assume independent primality. Readers of our two-point Chowla explainer will recognize why arithmetic dependence needs a proof rather than a probabilistic slogan.

8. Counting Arithmetic Tails Without Double-Counting Totients

Number of totients diagram shows overlapping tail-witness regions counted once using inclusion–exclusion.
Number of totients diagram shows overlapping tail-witness regions counted once using inclusion–exclusion.

Let a tail witness be a particular choice of retained small primes and cofactor. Several witnesses may have the same totient dd. Each witness permits a region of continuous prefix coordinates.

Adding their volumes would count overlaps repeatedly. The correct object is the union of permitted regions, taken separately for each dd.

Two tail witnesses can permit overlapping prefix regionsTwo overlapping rectangles labeled Witness one and Witness two represent schematic admissible prefix regions for the same tail totient d. The overlap is explicitly marked Count once. Rectangle areas do not encode measured values.Witness 1Witness 2Countonce
Schematic regions for the same tail totient d. Solid and dashed borders distinguish witnesses. Count the union, including the labeled overlap once. Areas are illustrative.

Suppose two tail witnesses permit the same prefix point. They generate the same output because their tail totients agree. If only one permits a different point, that point must still survive. Choosing one witness arbitrarily would therefore lose legitimate configurations.

Finite inclusion–exclusion implements this union exactly: add individual regions, subtract pairwise intersections, and continue through larger intersections. Intersecting witness regions means imposing the strongest threshold at each slack coordinate.

Uniqueness of the prefix and multiplicity of tails therefore coexist. The former removes large-scale collisions. The latter survives inside an exact local calculation. Counting the union preserves both facts without pretending that one representative tail describes every admissible prefix.

9. Constructing the Arithmetic Coefficient A(1;θ)

Reverse the tail indices by writing Qh=pm−hQ_h=p_{m-h} for P≤h<HP\le h<H. For a phase s∈[0,1)s\in[0,1), put αs=λeλs\alpha_s=\lambda e^{\lambda s}. The paper bounds the permitted tail primes and cofactors explicitly, leaving finitely many witnesses for each fixed HH, even across all phases.

Each witness η\eta contributes thresholds through D(h,η)=∑l=PH−1ah−lloglogQlD(h,\eta)=\sum_{l=P}^{H-1}a_{h-l}\log\log Q_l for h≥Hh\ge H. Independent mean-one exponential variables EhE_h encode the limiting slack constraints:

Eη=⋂h≥H{Eh≥γαsρhD(h,η)}.E_\eta=\bigcap_{h\ge H}\left\{E_h\ge\frac{\gamma}{\alpha_s}\rho^hD(h,\eta)\right\}.

These are auxiliary probability variables, not an assumption that the original primes are independent. Like the distributions discussed in log-concave sampling, they provide a precise mathematical representation.

For constant weight one, AH(1;s)A_H(1;s) sums the union probabilities over distinct tail totients, each weighted by 1/d1/d, then multiplies by ρH(H−1)/2(γ/αs)H\rho^{H(H-1)/2}(\gamma/\alpha_s)^H. The reciprocal weight comes from counting the largest prime. The prefactor comes from the ratio of prefix and full simplex volumes.

Write W\mathcal W for the finite witness set for a fixed tail totient. Its union probability is given by:

Pr⁡(⋃η∈𝒲Eη)=∑⌀≠T⊆𝒲(−1)|T|−1e−J(T),\Pr\left(\bigcup_{\eta\in\mathcal W}E_\eta\right)=\sum_{\varnothing\ne T\subseteq\mathcal W}(-1)^{|T|-1}e^{-J(T)},
J(T)=γαs∑h≥Hρhmaxη∈T⁡D(h,η).J(T)=\frac{\gamma}{\alpha_s}\sum_{h\ge H}\rho^h\max_{\eta\in T}D(h,\eta).

Here |T||T| counts witnesses in the subset. The maximum enforces every threshold in the intersection. Inclusion–exclusion turns each probability into exponential weights involving convergent series. Thus finite arithmetic data still involve an infinite analytic series. The approximants converge uniformly to A(1;s)A(1;s) as H→∞H\to\infty. Positivity and uniform bounds make the final approximation relative rather than merely additive. No evaluated decimal coefficient or practical convergence rate is supplied.

10. Why OpenAI’s Proof Establishes V(cx)/V(x) → c

One might substitute the asymptotic formula at two endpoints and cancel. That risks assuming regularity of the phase coefficient, which the theorem does not assert.

Instead, the paper counts the largest prime first. After fixing the remaining data, the allowed largest-prime range has an endpoint proportional to the output cutoff. The prime number theorem then produces a main term proportional to that cutoff.

For endpoints xx and x/cx/c, the proof uses the same parameters and representation mass. Their comparison establishes:

V(cx)V(x)⟶c(c>0 fixed).\frac{V(cx)}{V(x)}\longrightarrow c\qquad(c>0\text{ fixed}).

This is regular variation of totients with index one. It is proved before identifying the coefficient. Even when the integer mm changes between endpoints, no continuity assumption is smuggled into the comparison.

Unlike the algorithmic guarantee examined in counting perfect matchings, this limit supplies neither a selectable finite-input error nor a demonstrated runtime improvement. It describes asymptotic growth, without specifying where a desired numerical accuracy begins.

11. Least Preimages: Theorem 2.2 and the Questions Still Open

Define ℓ(v)=min{n≥1:φ(n)=v}\ell(v)=\min\{n\ge1:\varphi(n)=v\}. For a fixed positive integer kk, let Nk(x)N_k(x) count totients v≤xv\le x whose least preimage satisfies kx<ℓ(v)≤(k+1)xkx<\ell(v)\le(k+1)x. Notice the interval uses xx, not vv.

The weight fk(r)=min{1,(k+1)/r}−min{1,k/r}f_k(r)=\min\{1,(k+1)/r\}-\min\{1,k/r\} measures an allowed interval fraction, evaluated at the tail ratio r=ℓ(d)/d≥1r=\ell(d)/d\ge1. It vanishes when r≤kr\le k and is positive when r>kr>k. Theorem 2.2 gives:

Nk(x)=xlog⁡xGm(A(fk;θ)+o(1)).N_k(x)=\frac{x}{\log x}G_m\bigl(A(f_k;\theta)+o(1)\bigr).

Here o(1)o(1) tends to zero. If some totient dd satisfies the seed condition ℓ(d)>kd\ell(d)>kd, the coefficient is uniformly positive and Nk(x)N_k(x) has order V(x)V(x), meaning comparable upper and lower bounds with constants depending on kk. Without such a seed, the count is identically zero. Positive cases are established for k=1,2k=1,2.

Whether ℓ(d)/d\ell(d)/d is unbounded remains unresolved. A positive result for one seed does not supply seeds at every larger threshold. The weighted theorem identifies exactly what additional arithmetic evidence would be needed. The manuscript also supplies no empirical evidence for faster factoring, cryptographic attacks, or practical totient enumeration.

The published Lean scope covers the asymptotic equivalent, fixed scaling, and least-preimage results. Scope documentation is distinct from independently replaying the code, which this article has not done. Our Fermat formalization guide explains why matching a formal statement to the intended mathematics matters.

As checked on October 30, 2026, the Formal Conjectures tracker marks scaling solved while retaining the asymptotic-formula question as open. That classification does not erase the manuscript’s explicitly constructed equivalent, but it prevents declaring every interpretation of Problem 416 closed.

The number of totients now has a sharper mathematical description: continuous geometry for large primes, exact arithmetic for tails, and a union that counts outputs once. Follow Binary Verse AI for further source-led explanations of what AI mathematics proves and how its arguments work.

What are totient numbers?

Totient numbers are positive integers that occur as values of Euler’s totient function φ(n)\varphi(n). For example, φ(20)=8\varphi(20)=8, so 8 is a totient. Not every positive integer occurs as a totient.

What is the difference between calculating a totient and counting distinct totient values?

Calculating φ(n)\varphi(n) gives one output for a particular integer. The totient counting function V(x)V(x) counts how many different outputs occur up to xx, even when several inputs produce the same output. The cutoff applies to outputs, not inputs.

How many distinct totient values are there below x?

Counting values up to and including xx, OpenAI’s Theorem 2.1 gives V(x)~(x/logx)GmA(1;θ)V(x)\sim(x/\log x)G_mA(1;\theta) as x→∞x\to\infty. The scale and phase-dependent coefficient are explicitly defined through arithmetic constructions. This is an asymptotic equivalent, not an exact finite-cutoff count.

Why didn’t Ford’s earlier formula settle the number of totients?

Ford determined the correct order within bounded multiplicative uncertainty. That remaining uncertainty did not establish an asymptotic equivalent, where the ratio to a specified main term tends to one, or determine the precise fixed-dilation limit.

Does V(2x)/V(x) → 2 mean totient numbers become common?

No. Totient values have natural density zero: V(x)/x→0V(x)/x\to0. The doubling result V(2x)/V(x)→2V(2x)/V(x)\to2 describes how their count changes between large multiplicative scales, not a positive density among all integers.

Is the coefficient A(1;θ) an ordinary constant?

It is a positive, bounded function of a phase parameter, constructed as the uniform limit of arithmetic approximations. The manuscript does not replace it with one fixed numerical constant or assert continuity of that function.

Did OpenAI’s proof resolve every open question about totients?

No. It establishes fixed scaling and an asymptotic equivalent, along with least-preimage results. Whether ℓ(d)/d\ell(d)/d is unbounded remains unresolved in the paper. As checked on October 30, 2026, the Formal Conjectures tracker marks scaling solved but retains the asymptotic-formula part of Erdős Problem 416 as open.

Leave a Comment