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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Factor bounds for Fermat numbers

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: the dyadic valuation of A93179(n) - 1 does not exceed 2^n - a(n).

A93179(n) is minFac(fermatNumber n), the smallest prime factor of the n-th Fermat number. The conjecture states that if PnP_n is the smallest prime factor of the nn-th Fermat number, then ν2(Pn−1)≤2n−a(n)\nu_2(P_n - 1) \le 2^n - a(n). Substituting the definition of a(n)a(n), this is equivalent to ν2(Pn−1)≤⌊log⁡2(Pn)⌋\nu_2(P_n - 1) \le \lfloor \log_2(P_n) \rfloor.

This is Conjecture 3.4 in [SA22].

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

Formal statement

theorem oeis_358684_conjecture_0 (n : ℕ) :
    padicValNat 2 (minFac (fermatNumber n) - 1) ≤ 2 ^ n - a n
Show the full Challenge.lean (169 lines) — definitions included
module

public import FormalConjecturesUtil
meta import Mathlib.NumberTheory.Fermat

/-!
# Factor bounds for Fermat numbers

$a(n)$ is the minimum integer $k$ such that the smallest prime factor of the
$n$-th Fermat number exceeds $2^{2^n - k}$.

*References:*
- [A358684](https://oeis.org/A358684)
- [SA22](https://doi.org/10.26493/2590-9770.1473.ec5) Lorenzo Sauras-Altuzarra, *Some properties of the factors of Fermat numbers*, Art Discrete Appl. Math. (2022).
-/

@[expose] public section


namespace OeisA358684

open Nat

/--
A358684: $a(n)$ is the minimum integer $k$ such that the smallest prime factor of the $n$-th Fermat
number exceeds $2^{2^n - k}$.
Let $F_n = 2^{2^n} + 1$ be the $n$-th Fermat number, and $P_n$ be its smallest prime factor.
The definition of $a(n)$ is equivalent to the closed form:
$$a(n) = 2^n - \lfloor \log_2(P_n) \rfloor$$
where $P_n = \operatorname{minFac}(\operatorname{fermatNumber} n)$.
The subtraction is defined in $\mathbb{N}$ and is safe
 since $P_n \le F_n$, implying $\log_2 P_n < 2^n$.
-/
def a (n : ℕ) : ℕ :=
  letI pn := minFac (fermatNumber n)
  (2 ^ n) - (log2 pn)

/--
The "original" definition: $a'(n)$ is the minimum $k$ such that $P_n > 2^{2^n - k}$.
We use `Nat.find` which returns the smallest natural number satisfying a predicate.
-/
noncomputable def a' (n : ℕ) : ℕ :=
  letI Pn := minFac (fermatNumber n)
  Nat.find (show ∃ k, Pn > 2 ^ (2 ^ n - k) from by
    use 2^n
    simp only [tsub_self, pow_zero]
    simp [Pn]
    unfold Nat.fermatNumber
    exact (Nat.minFac_prime (by norm_num)).one_lt
  )


/--
The log2 of the smallest prime factor of $F_n$ is at most $2^n$.
-/
@[category textbook, AMS 11]
private lemma log2_minFac_le (n : ℕ) : log2 (fermatNumber n).minFac ≤ 2^n := by
  rw [log2_eq_log_two]
  refine (log_mono_right (minFac_le (by rw [fermatNumber]; norm_num))).trans_eq ?_
  rw [fermatNumber, log_eq_of_pow_le_of_lt_pow (le_add_right _ _)]
  rw [pow_succ, mul_two]
  gcongr
  exact one_lt_pow (by norm_num) (by norm_num)

/--
The minimization definition is equivalent to the closed form.
-/
@[category API, AMS 11]
theorem a_equiv_a' (n : ℕ) : a n = a' n := by
  unfold a a'; set Pn := (fermatNumber n).minFac
  rw [Eq.comm, Nat.find_eq_iff]
  constructor
  · rw [tsub_tsub_cancel_of_le (log2_minFac_le n), log2_eq_log_two]
    refine lt_of_le_of_ne (pow_log_le_self 2 (Nat.Prime.ne_zero (minFac_prime ?_))) fun h => ?_
    · rw [fermatNumber]
      norm_num
    · have hPn : Pn.Prime := minFac_prime (by rw [fermatNumber]; norm_num)
      have hnz := log2_eq_log_two ▸ (Nat.log_pos one_lt_two hPn.two_le).ne'
      refine (Nat.not_even_iff_odd.mpr <| (odd_pow_iff hnz).mp ?_) even_two
      rw [log2_eq_log_two, h]
      exact Odd.of_dvd_nat (odd_fermatNumber n) (minFac_dvd _)
  · intro m hm; simp only [not_lt]
    rw [lt_tsub_iff_left] at hm
    rw [log2_eq_log_two] at hm
    refine (lt_pow_succ_log_self (b:=2) (by norm_num) _).le.trans ?_
    apply Nat.pow_le_pow_right (by norm_num)
    apply le_tsub_of_add_le_right
    have := succ_le_of_lt hm
    omega

@[category test, AMS 11]
theorem a_0 : a 0 = 0 := by norm_num [a]; simp [log2_def]

@[category test, AMS 11]
theorem a_1 : a 1 = 0 := by norm_num [a]; simp [log2_def]

@[category test, AMS 11]
theorem a_2 : a 2 = 0 := by norm_num [a]; simp [log2_def]

@[category test, AMS 11]
theorem a_3 : a 3 = 0 := by
  unfold a Nat.fermatNumber
  norm_num
  decide

@[category test, AMS 11]
theorem a_4 : a 4 = 0 := by
  unfold a Nat.fermatNumber
  norm_num
  decide

@[category test, AMS 11]
theorem a_5 : a 5 = 23 := by
  unfold a Nat.fermatNumber
  norm_num
  decide

@[category test, AMS 11]
theorem a_6 : a 6 = 46 := by
  decide +native

@[category test, AMS 11]
theorem a_7 : a 7 = 73 := by
  sorry

/--
Conjecture: the dyadic valuation of A93179(n) - 1 does not exceed 2^n - a(n).

A93179(n) is minFac(fermatNumber n), the smallest prime factor of the n-th Fermat number.
The conjecture states that if $P_n$ is the smallest prime factor of the $n$-th Fermat number,
then $\nu_2(P_n - 1) \le 2^n - a(n)$.
Substituting the definition of $a(n)$, this is equivalent to $\nu_2(P_n - 1) \le \lfloor \log_2(P_n) \rfloor$.

This is Conjecture 3.4 in [SA22].
-/
@[category research solved, AMS 11]
theorem oeis_358684_conjecture_0 (n : ℕ) :
    padicValNat 2 (minFac (fermatNumber n) - 1) ≤ 2 ^ n - a n := by
  delta fermatNumber and a
  rw [Nat.sub_sub_self]
  · rw [Nat.log2_eq_log_two]
    apply Nat.le_log_of_pow_le (by decide)
    refine le_trans ?_ <| sub_le _ 1
    apply Nat.ordProj_le 2
    exact Nat.sub_ne_zero_of_lt (Nat.minFac_prime (by norm_num)).one_lt
  · rw [Nat.log2_eq_log_two]
    have : (2 ^ 2 ^ n) + 1 < 2 ^ ((2 ^ n) + 1) := by
      simp [pow_add, mul_two]
    refine Nat.le_of_lt_succ <| (2).log_lt_of_lt_pow ?_ ?_
    · exact Nat.minFac_pos _|>.ne'
    · exact (Nat.minFac_le (by bound)).trans_lt this

end OeisA358684

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

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

Formal variants

Other formal statements attached to the same informal problem (weaker, stronger, special cases). Each is scored separately.

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.