/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ module public import FormalConjecturesUtil

Descartes Numbers

A Descartes number (or spoof odd perfect integer) is an odd integer $n = m \cdot w$ where $w$ is composite (Nat.Composite), $\gcd(m, w) = 1$, and $\sigma_1(m)(w + 1) = 2 m w$, so treating $w$ as a prime factor would yield $\sigma_1(n) = 2n$. René Descartes (1638) found $$D = 3^2 \cdot 7^2 \cdot 11^2 \cdot 13^2 \cdot 22021 = 198{,}585{,}576{,}189,$$ with composite spoof factor $22021 = 19^2 \cdot 61$; no further example is known [KW91]. Banks, Güloğlu, Nevans, and Saidak [BGNS08] proved that $D$ is the unique cube-free Descartes integer with fewer than seven distinct prime divisors and that every cube-free Descartes integer coprime to $3$ has over $10^6$ distinct prime divisors; Tóth [To21] showed that any other Descartes factorization $n = m \cdot w \ne D$ satisfies $m > 10^{12}$.

References:

    Wikipedia

    [KW91] V. Klee and S. Wagon (1991), Dolciani Math. Expositions 11, Math. Assoc. America.

    [BGNS08] W. D. Banks, A. M. Güloğlu, C. W. Nevans, and F. Saidak (2008), CRM Proc. Lecture Notes 46, Amer. Math. Soc., 167–173.

    [To21] L. Tóth (2021), Comput. Methods Sci. Technol. 27, no. 1, 25–31.

@[expose] public sectionnamespace DescartesNumberopen scoped ArithmeticFunction.sigma

Descartes's 1638 example $3^2 \cdot 7^2 \cdot 11^2 \cdot 13^2 \cdot 22021 = 198{,}585{,}576{,}189$.

def descartesExample : ℕ := 198585576189

(m, w) is a Descartes factorization if $w$ is composite (Nat.Composite), $m \cdot w$ is odd, $\gcd(m, w) = 1$, and $\sigma_1(m)(w + 1) = 2 m w$ (which together force $m > 1$).

def IsDescartesFactorization (m w : ℕ) : Prop := w.Composite ∧ Odd (m * w) ∧ Nat.Coprime m w ∧ σ 1 m * (w + 1) = 2 * m * w

IsDescartesNumber n holds when $n = m \cdot w$ for some IsDescartesFactorization m w.

def IsDescartesNumber (n : ℕ) : Prop := ∃ m w : ℕ, n = m * w ∧ IsDescartesFactorization m w

Every Descartes number is odd and strictly greater than $1$.

m:ℕw:ℕhw1:1 < wright✝¹:¬Nat.Prime whodd:Odd (m * w)right✝:m.Coprime w ∧ (σ 1) m * (w + 1) = 2 * m * whm0:0 < m⊢ Odd (m * w) ∧ 1 < m * w exact ⟨hodd, m:ℕw:ℕhw1:1 < wright✝¹:¬Nat.Prime whodd:Odd (m * w)right✝:m.Coprime w ∧ (σ 1) m * (w + 1) = 2 * m * whm0:0 < m⊢ 1 < m * w All goals completed! 🐙⟩

For any odd integer $m$ satisfying $\sigma_1(m) = 2m - 1$ (almost perfect, cf. AlmostPerfectNumbers) such that $2m - 1$ is composite, the product $m(2m - 1)$ satisfies IsDescartesNumber.

m:ℕhodd:Odd mhap:(σ 1) m = 2 * m - 1hcomp:(2 * m - 1).Compositehm1:1 < mthis:2 * m - 1 + 1 = 2 * m⊢ (2 * m - 1) * (2 * m) = 2 * m * (2 * m - 1) All goals completed! 🐙

Descartes's classical integer descartesExample satisfies IsDescartesNumber.

hmul:(σ 1).IsMultiplicativehs1:(σ 1) (3 ^ 2 * (7 ^ 2 * (11 ^ 2 * 13 ^ 2))) = (σ 1) (3 ^ 2) * ((σ 1) (7 ^ 2) * ((σ 1) (11 ^ 2) * (σ 1) (13 ^ 2)))h3:(σ 1) (3 ^ 2) = 13h7:(σ 1) (7 ^ 2) = 57h11:(σ 1) (11 ^ 2) = 133h13:(σ 1) (13 ^ 2) = 183⊢ 13 * (57 * (133 * 183)) * (22021 + 1) = 2 * (3 ^ 2 * (7 ^ 2 * (11 ^ 2 * 13 ^ 2))) * 22021 All goals completed! 🐙

descartesExample is cube-free (Powerfree 3 descartesExample).

x:ℕhx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* 11 ^ 2 * 13 ^ 2 * 19 ^ 2 * 61 → Falseh61:q ∣ 61⊢ Nat.Prime 61 All goals completed! 🐙 : Nat.Prime 61).eq_one_or_self_of_dvd q h61 with rfl | rfl x:ℕhx:x ^ 3 ∣ descartesExamplehx1:¬x = 1hqp:Nat.Prime 1hqdvd:1 ∣ xhq3:1 ^ 3 ∣ 3 ^ 2 * 7 ^ 2 * 11 ^ 2 * 13 ^ 2 * 19 ^ 2 * 61hp_abs:∀ {p : ℕ}, Nat.Prime p → 1 ∣ p ^ 2 → ¬p ^ 3 ∣ 3 ^ 2 * 7 ^ 2 * 11 ^ 2 * 13 ^ 2 * 19 ^ 2 * 61 → Falseh61:1 ∣ 61⊢ False All goals completed! 🐙 x:ℕhx:x ^ 3 ∣ descartesExamplehx1:¬x = 1hqp:Nat.Prime 61hqdvd:61 ∣ xhq3:61 ^ 3 ∣ 3 ^ 2 * 7 ^ 2 * 11 ^ 2 * 13 ^ 2 * 19 ^ 2 * 61hp_abs:∀ {p : ℕ}, Nat.Prime p → 61 ∣ p ^ 2 → ¬p ^ 3 ∣ 3 ^ 2 * 7 ^ 2 * 11 ^ 2 * 13 ^ 2 * 19 ^ 2 * 61 → Falseh61:61 ∣ 61⊢ False All goals completed! 🐙

Banks–Güloğlu–Nevans–Saidak Theorem [BGNS08]: every cube-free Descartes integer not divisible by $3$ has strictly more than $10^6$ distinct prime factors.

@[category research solved, AMS 11] theorem descartes_cubeFree_not_dvd_three_primeFactors_gt_million (n : ℕ) (hd : IsDescartesNumber n) (hcf : Powerfree 3 n) (h3 : ¬ 3 ∣ n) : 10 ^ 6 < n.primeFactors.card := n:ℕhd:IsDescartesNumber nhcf:Powerfree 3 nh3:¬3 ∣ n⊢ 10 ^ 6 < n.primeFactors.card All goals completed! 🐙

Tóth's Lower Bound on Spoof Factorizations [To21]: every Descartes factorization $m \cdot w \ne 198{,}585{,}576{,}189$ satisfies $m > 10^{12}$.

@[category research solved, AMS 11] theorem descartes_non_example_factor_gt_ten_pow_twelve (m w : ℕ) (hf : IsDescartesFactorization m w) (hne : m * w ≠ descartesExample) : 10 ^ 12 < m := m:ℕw:ℕhf:IsDescartesFactorization m whne:m * w ≠ descartesExample⊢ 10 ^ 12 < m All goals completed! 🐙

Banks–Güloğlu–Nevans–Saidak Uniqueness Theorem [BGNS08] (see also [To21, §1]): $198{,}585{,}576{,}189$ is the unique cube-free Descartes integer with fewer than seven distinct prime divisors.

@[category research solved, AMS 11] theorem descartes_cubeFree_lt_seven_primeFactors_unique (n : ℕ) (hd : IsDescartesNumber n) (hcf : Powerfree 3 n) (hcard : n.primeFactors.card < 7) : n = descartesExample := n:ℕhd:IsDescartesNumber nhcf:Powerfree 3 nhcard:n.primeFactors.card < 7⊢ n = descartesExample All goals completed! 🐙

Is $198{,}585{,}576{,}189$ the only Descartes number?

@[category research open, question, AMS 11] theorem descartes_number_unique : ∀ n : ℕ, IsDescartesNumber n → n = descartesExample := ⊢ ∀ (n : ℕ), IsDescartesNumber n → n = descartesExample All goals completed! 🐙end DescartesNumber