Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Characterization of Carmichael numbers via squarefree denominators a(n)a(n)

Source:OEIS conjectures
Known result Solved on paper; nobody has proved it in Lean here yet. First verified proof: +10 points.
Statement:reviewed
Statement:

Conjecture: composite numbers nn such that a(n)a(n) is squarefree are only the Carmichael numbers (A002997). - Thomas Ordowski, Jul 15 2019

A formal proof has been found with the methods described in arxiv/2605.22763.

Subjects:Number Theory (math.NT)
MSC classes:11
Tags:formal_proof
Cite as:NS.06191 [math.NT] · NS.06191v1 for this version
Declaration:OeisA309132.carmichael_iff_squarefree_a
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 10, later ones: 2; accepted critique: up to 60
Statement hash:3b39b3eabd3032b39222d0d86b0ec95571992e5326722caaf30eec9c5c362e11
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/309132.lean

Formal statement

theorem carmichael_iff_squarefree_a :
    ∀ (n : ℕ), (IsComposite n ∧ Squarefree (a n)) ↔ IsCarmichaelNumber n
Show the full Challenge.lean (91 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Characterization of Carmichael numbers via squarefree denominators $a(n)$

$a(n)$ is the denominator of $F(n) = \operatorname{num}(B_{n-1})/n + \operatorname{den}(B_{n-1})/n^2$.

A composite number $n$ has squarefree $a(n)$ if and only if $n$ is a Carmichael number.

*References:*
- [A309132](https://oeis.org/A309132)
- [arxiv/2605.22763](https://arxiv.org/abs/2605.22763) *Advancing Mathematics Research with AI-Driven Formal Proof Search* by George Tsoukalas et al.
- [A027641](https://oeis.org/A027641)
- [A027642](https://oeis.org/A027642)
-/

@[expose] public section

namespace OeisA309132


open Rat Nat

/--
$a(n)$ is the denominator of $F(n)$ = A027641(n-1)/n + A027642(n-1)/n^2.
-/
def a (n : ℕ) : ℕ :=
  if n = 0 then 0
  else
    let n_q : ℚ := n
    let B_nm1 : ℚ := bernoulli (n - 1)
    let F_n : ℚ := (B_nm1.num : ℚ) / n_q + (B_nm1.den : ℚ) / (n_q * n_q)
    F_n.den

/-- Definition of a Carmichael number $n$: a composite number s.t.
$b^{n-1} \equiv 1 \pmod n$ for all $b$ coprime to $n$. -/
def IsCarmichaelNumber (n : ℕ) : Prop :=
  (¬ Nat.Prime n ∧ n > 1) ∧ (∀ b : ℕ, Nat.gcd b n = 1 → b ^ (n - 1) ≡ 1 [MOD n])

/-- Helper definition for "composite number" -/
def IsComposite (n : ℕ) : Prop := ¬ Nat.Prime n ∧ n > 1


@[category test, AMS 11]
lemma a_1 : a 1 = 1 := by delta a; norm_num [bernoulli]

@[category test, AMS 11]
lemma a_2 : a 2 = 1 := by delta a; norm_num [bernoulli]

@[category test, AMS 11]
lemma a_3 : a 3 = 1 := by delta a; norm_num [bernoulli]

@[category test, AMS 11]
lemma a_4 : a 4 = 16 := by delta a; norm_num [bernoulli]

@[category test, AMS 11]
lemma a_5 : a 5 = 1 := by delta a; norm_num [bernoulli]


set_option linter.style.formal_proof_palomar false in
/--
Conjecture: composite numbers $n$ such that $a(n)$ is squarefree are only the Carmichael numbers (A002997). - _Thomas Ordowski_, Jul 15 2019

A formal proof has been found with the methods described in
[arxiv/2605.22763](https://arxiv.org/abs/2605.22763).
-/
@[category research solved, AMS 11, formal_proof using formal_conjectures at
"https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/309132.wip.lean#L353"]
theorem carmichael_iff_squarefree_a :
    ∀ (n : ℕ), (IsComposite n ∧ Squarefree (a n)) ↔ IsCarmichaelNumber n := by
    sorry

end OeisA309132

To prove it: keep every definition of Challenge.lean unchanged and prove OeisA309132.carmichael_iff_squarefree_a with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_carmichael_iff_squarefree_a : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry fetch oeis-309132
nosorry submit oeis-309132 nosorry/oeis-309132/Solution.lean --wait

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.