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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Difference between first odd semiprime >2n> 2^n and 2n2^n · a_5

Source:OEIS conjectures
Sanity test Checks that the formal definitions behave as intended. First verified proof: +1 points.
Statement:reviewed
Statement:

No informal statement.

Subjects:Number Theory (math.NT)
MSC classes:11
Cite as:NS.04803 [math.NT] · NS.04803v1 for this version
Declaration:OeisA114137.a_5
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 1; accepted critique: up to 100
Statement hash:028df124b483a36d0e17e18e476814f579c4ff9879e9bc2a18d7c72230be4800
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/114137.lean

Formal statement

theorem a_5 : a 5 = 1
Show the full Challenge.lean (119 lines) — definitions included
module

public import FormalConjecturesUtil


/-!
# Difference between first odd semiprime $> 2^n$ and $2^n$

*References:*
- [A114137](https://oeis.org/A114137)
-/

@[expose] public section

namespace OeisA114137
open Nat

/--
The primary defining sequence `a`.
$a(n)$ is the difference between first odd semiprime > $2^n$ and $2^n$.
$$a(n) = \min \{s \mid s > 2^n \text{ and } s \text{ is an odd semiprime}\} - 2^n$$
-/
noncomputable def a (n : ℕ) : ℕ :=
  let m := 2^n
  let s : Set ℕ := { s | s > m ∧ s.IsSemiprime ∧ Odd s }
  sInf s - m

@[category API, AMS 11]
lemma a_eq_of (n val : ℕ)
  (h_mem : val.IsSemiprime ∧ Odd val)
  (h_gt : 2^n < val)
  (h_min : ∀ x, 2^n < x → x < val → ¬ (x.IsSemiprime ∧ Odd x)) :
  a n = val - 2^n := by
  change sInf { s | s > 2^n ∧ s.IsSemiprime ∧ Odd s } - 2^n = val - 2^n
  have h_S : sInf { s | s > 2^n ∧ s.IsSemiprime ∧ Odd s } = val := by
    apply IsLeast.csInf_eq
    constructor
    · exact ⟨h_gt, h_mem⟩
    · rintro x ⟨hx1, hx2⟩
      by_contra! h
      exact h_min x hx1 h hx2
  rw [h_S]

@[category test, AMS 11]
theorem a_1 : a 1 = 7 := by
  apply a_eq_of 1 9 (by
    norm_num [IsSemiprime, IsAlmostPrime, ArithmeticFunction.cardFactors_apply,
      Nat.primeFactorsList]) (by norm_num)
  intro x h1 h2
  interval_cases x <;>
    norm_num [IsSemiprime, IsAlmostPrime, ArithmeticFunction.cardFactors_apply]

@[category test, AMS 11]
theorem a_2 : a 2 = 5 := by
  apply a_eq_of 2 9 (by
    norm_num [IsSemiprime, IsAlmostPrime, ArithmeticFunction.cardFactors_apply,
      Nat.primeFactorsList]) (by norm_num)
  intro x h1 h2
  interval_cases x <;>
    norm_num [IsSemiprime, IsAlmostPrime, ArithmeticFunction.cardFactors_apply]

@[category test, AMS 11]
theorem a_3 : a 3 = 1 := by
  apply a_eq_of 3 9 (by
    norm_num [IsSemiprime, IsAlmostPrime, ArithmeticFunction.cardFactors_apply,
      Nat.primeFactorsList]) (by norm_num)
  intro x h1 h2
  interval_cases x

@[category test, AMS 11]
theorem a_4 : a 4 = 5 := by
  apply a_eq_of 4 21 (by
    norm_num [IsSemiprime, IsAlmostPrime, ArithmeticFunction.cardFactors_apply,
      Nat.primeFactorsList]) (by norm_num)
  intro x h1 h2
  interval_cases x <;>
    norm_num [IsSemiprime, IsAlmostPrime, ArithmeticFunction.cardFactors_apply]

@[category test, AMS 11]
theorem a_5 : a 5 = 1 := by
  apply a_eq_of 5 33 (by
    norm_num [IsSemiprime, IsAlmostPrime, ArithmeticFunction.cardFactors_apply,
      Nat.primeFactorsList]) (by norm_num)
  intro x h1 h2
  interval_cases x

/--
In this powers of 2 sequence, does 1 occur infinitely often?
-/
@[category research open, question, AMS 11]
theorem conjecture1 :
  Set.Infinite {n : ℕ | a n = 1} := by
  sorry

/--
Does every odd number occur?
-/
@[category research open, question, AMS 11]
theorem conjecture2 :
  ∀ k : ℕ, Odd k → ∃ n : ℕ, a n = k := by
  sorry

end OeisA114137

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

nosorry desk oeis-114137--a-5      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch oeis-114137--a-5
nosorry submit oeis-114137--a-5 nosorry/oeis-114137--a-5/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.