Skip to content
DAH

Lehmer's totient problem: is there a composite n with φ(n) dividing n − 1?

OpenTo verify: Lean proofPosed by Derrick Henry Lehmer, 1932
AI-reviewed
On this page17 sections
Difficulty
72/100Major open
How far from a resolution. P vs NP = 100
Application value
4/100Theoretical
Realistic practical impact if resolved. P vs NP = 100
Leverage
10/100Isolated
How much other knowledge hinges on it. P vs NP = 100

Difficulty 72: ninety years old with no line of attack beyond narrowing the shape of a hypothetical solution (Carmichael, squarefree, at least 14 prime factors), comparable to the Hadamard conjecture (70.5) and below Lindelöf (74), where at least the exponent keeps moving. A single large example could settle it, which keeps it below the Landau-type problems (84 and up). Application value 4: pseudoprime-type conditions matter to primality testing, but no practice depends on the answer. Leverage 10: essentially stand-alone.

The problem

Is there a non-prime number n for which the count of numbers coprime to n divides n minus 1?

  1. 1For primes, the count equals n minus 1
  2. 2Does a composite number share this?
  3. 3An example needs 14+ odd prime factors
  4. 4None known, none ruled out

Euler's totient. For a positive integer nn, φ(n)\varphi(n) counts the numbers from 11 to nn that share no factor with nn other than 1 (they are coprime to nn). For example φ(10)=4\varphi(10)=4: the numbers 1, 3, 7, 9. If pp is prime, every number from 1 to p−1p-1 is coprime to it, so φ(p)=p−1\varphi(p)=p-1, and in particular φ(p)\varphi(p) divides p−1p-1.

The question. Lehmer asked in 1932 whether this divisibility can happen for a composite nn (a whole number above 1 that is not prime): is there a composite nn with φ(n)∣n−1\varphi(n)\mid n-1? If not, the condition is an exact test for primality. In Lean: ∃ n > 1, ¬Prime n ∧ Nat.totient n ∣ n - 1.

Try a few. For a product of distinct primes, φ(p1p2⋯pr)=(p1−1)(p2−1)⋯(pr−1)\varphi(p_1p_2\cdots p_r)=(p_1-1)(p_2-1)\cdots(p_r-1). For n=15=3⋅5n=15=3\cdot5: φ(15)=8\varphi(15)=8, and 14 is not a multiple of 8. For n=561=3⋅11⋅17n=561=3\cdot11\cdot17: φ(561)=2⋅10⋅16=320\varphi(561)=2\cdot10\cdot16=320, and 560 is not a multiple of 320. Requiring n−1n-1 to be a multiple of the whole product ∏(pi−1)\prod(p_i-1) is a strong condition, and no composite example has ever been found.

What a solution would have to look like. Lehmer proved that a solution must be odd, have no repeated prime factor (squarefree) and have at least 7 distinct prime factors; Cohen and Hagis (1980) raised this to 14. Each pi−1p_i-1 divides φ(n)\varphi(n) and hence n−1n-1, which makes nn a Carmichael number: a composite that fools Fermat's primality test, because an−1a^{n-1} leaves remainder 1 on division by nn for every aa coprime to nn. If 3 divides a solution, it has more than 40 million prime factors (Burcsi, Czirbusz and Farkas, 2011). Luca and Pomerance (2011) showed that solutions, if any exist, are rare: roughly at most X\sqrt X of them below XX.

Why it is stuck. These results narrow the shape of a solution without ruling it out, and the remaining candidates are far too large to search.

How an answer is checked. A yes-answer is one number with its factorization: Lean can compute φ(n)\varphi(n) from the factors and check the divisibility with integer arithmetic. A no-answer needs a proof for every nn. The problem is a cousin of the Agoh–Giuga conjecture, another congruence test for primes whose counterexamples would also have to be Carmichael numbers.

Go deeper

The full technical text.

Does there exist a composite integer nn such that Euler's totient φ(n)\varphi(n) divides n−1n-1? For a prime nn the divisibility always holds, so the question is whether it characterizes primes.

Lean 4 statement in the Formal Conjectures corpus, where the open question is whether the existential holds:

theorem lehmer_totient :
    ∃ n > 1, ¬Prime n ∧ Nat.totient n ∣ n - 1
Words on this page (6)
Words on this page
Euler's totient
The number of integers from 1 to n that share no factor with n.
composite number
A whole number above 1 that is not prime.
squarefree
A number not divisible by the square of any prime.
Carmichael number
A composite number that fools a standard primality test based on Fermat's little theorem.
coprime
Having no common factor other than 1.
Agoh–Giuga conjecture
A related claim that a power-sum congruence detects primes.
New to this? Read first (2)
New to this? Read first

Path to understanding

foundations → problem

The research entries this problem rests on, in the order to read them. Each links to its explainer.

  1. Start with
  2. Step 2
  3. Step 3
  4. Then
    • Lehmer's totient problem: is there a composite n with φ(n) dividing n − 1?The problem

State of the art

No composite solution is known. Lehmer (1932) showed a solution must be odd, squarefree, have at least 7 distinct prime factors and be a Carmichael number. Cohen and Hagis (1980) raised the prime-factor count to at least 14. Hagis (1988) showed that if 33 divides a solution then it exceeds 101,937,04210^{1{,}937{,}042} and has at least 298,848 prime factors; Burcsi, Czirbusz and Farkas (2011, Ann. Univ. Sci. Budapest. Sect. Comput. 35) raised this to more than 10360,000,00010^{360{,}000{,}000} and at least 40 million prime factors. Luca and Pomerance (2011) bound the number of solutions up to XX by roughly X1/2/(log⁡X)1/2X^{1/2}/(\log X)^{1/2}. Because solutions are rare or absent and any search must reach enormous sizes, neither computation nor current theory settles it.

Realistic applications

None. It is a clean test of what a congruence-type condition can say about primality, close in spirit to the primality tests (Fermat, Carmichael) that underlie cryptographic key generation, but no practice depends on the answer.

What counts as solved

Either a Lean proof of lehmer_totient (an explicit composite nn with φ(n)∣n−1\varphi(n) \mid n-1, checkable by the kernel) or a Lean proof of its negation, i.e. that φ(n)∣n−1\varphi(n)\mid n-1 forces nn prime.

How it gets verified

To verify: Lean proof

A formal proof checked by Lean 4 / Mathlib.

Statement: LehmerTotient.lehmer_totient in formal-conjectures: ∃ n > 1, ¬Prime n ∧ Nat.totient n ∣ n - 1. Mathlib has Nat.totient with a large API (Data.Nat.Totient), so no new definitions are needed. A positive answer is a certificate: an explicit nn plus its factorization, which Lean can verify (Nat.totient of a product of distinct primes is a product of p−1p-1, so the check reduces to big-integer arithmetic). A negative answer needs a genuine proof. Judge acceptance with Comparator against the pinned statement.

Claims

No claimed results on this problem.

Where the work is

Theory
72%
New mathematical or conceptual ideas
Engineering
0%
Building instruments, chips, systems, software, formal proofs
Compute
28%
Raw computation, search, simulation
Empirical
0%
Observation, experiment, data collection

A proof of nonexistence needs new structure theory; a counterexample would be found by a search constrained by the known shape (odd, squarefree, Carmichael, many primes).

Connected problems

Progress

  1. Jan 1, 2011
    Counting bound and the 3 | n case

    Luca and Pomerance bound the number of solutions; Burcsi, Czirbusz and Farkas push the 3 | n case to enormous size (year only known).

    source
  2. Jan 1, 1980
    At least 14 prime factors

    Cohen and Hagis raise the bound on distinct prime factors (year only known).

    source
  3. Jan 1, 1932
    Problem posed with first constraints

    Lehmer shows a solution must be odd, squarefree, a Carmichael number and have at least 7 prime factors.

    source