FormalConjectures/OEIS/182126.lean

GitHub source file

Explanation legend Lean4 Domain Explanation Language (L4DEL)

L4DEL explanations are a separate layer. They do not change the Lean source. Intuition is explanatory prose; numbered items are a reading path; sources link the wording back to evidence.

L4DEL
Lean4 Domain Explanation Language

Credit: The upstream authors and contributors retain credit for the project and mathematics. lean4-explainer only renders their pinned source and adds the separately disclosed explanation layer.

Project sources: Pinned project documentation, Formal Conjectures paper, arXiv v1

11 declarations, 3 contain sorry, 0 declared as axioms

Product of two consecutive primes modulo the next prime

The sequence is defined by $$a(n) = \mathrm{prime}(n) \cdot \mathrm{prime}(n+1) \bmod \mathrm{prime}(n+2),$$ where $\mathrm{prime}(k)$ is the $k$-th prime number ($\mathrm{prime}(1)=2$).

References:

Imports (1)
  1. def OeisA182126.prime $\mathrm{prime}(k)$ is the $k$-th prime number ($\mathrm{prime}(1) = 2$) line 35 source

    Source documentation

    $\mathrm{prime}(k)$ is the $k$-th prime number ($\mathrm{prime}(1) = 2$).

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: Nat.nth, Nat.Prime, HSub.hSub, OfNat.ofNat

    3 instances, coercions and auxiliary constants left out.

    noncomputable def prime (k : ℕ) : ℕ := Nat.nth Nat.Prime (k - 1)
  2. def OeisA182126.a $a(n) = \mathrm{prime}(n) \cdot \mathrm{prime}(n+1) \bmod \mathrm{prime}(n+2)$ line 38 source

    Source documentation

    $a(n) = \mathrm{prime}(n) \cdot \mathrm{prime}(n+1) \bmod \mathrm{prime}(n+2)$.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: ite, Eq, OfNat.ofNat, HMod.hMod, HMul.hMul, OeisA182126.prime, HAdd.hAdd

    8 instances, coercions and auxiliary constants left out.

    noncomputable def a (n : ℕ) : ℕ :=
    …
  3. theorem OeisA182126.a_1 line 43 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Eq, Nat, OeisA182126.a, OfNat.ofNat

    Proof uses: Nat.nth, Nat.Prime, Nat.nth_count, of_decide_eq_true, id, Bool, Decidable.decide, Bool.true, Eq.refl, Eq.mpr, HMod.hMod, HMul.hMul, congrArg

    7 instances, coercions and auxiliary constants left out.

    Tactic trace: 8 steps

    Open to load the checked before-and-after goal states.

  4. theorem OeisA182126.a_2 line 51 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Eq, Nat, OeisA182126.a, OfNat.ofNat

    Proof uses: Nat.nth, Nat.Prime, Nat.nth_count, of_decide_eq_true, id, Bool, Decidable.decide, Bool.true, Eq.refl, Eq.mpr, HMod.hMod, HMul.hMul, congrArg

    7 instances, coercions and auxiliary constants left out.

    Tactic trace: 8 steps

    Open to load the checked before-and-after goal states.

  5. theorem OeisA182126.a_3 line 59 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Eq, Nat, OeisA182126.a, OfNat.ofNat

    Proof uses: Nat.nth, Nat.Prime, Nat.nth_count, of_decide_eq_true, id, Bool, Decidable.decide, Bool.true, Eq.refl, Eq.mpr, HMod.hMod, HMul.hMul, congrArg

    7 instances, coercions and auxiliary constants left out.

    Tactic trace: 8 steps

    Open to load the checked before-and-after goal states.

  6. theorem OeisA182126.a_4 line 67 source

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Eq, Nat, OeisA182126.a, OfNat.ofNat

    Proof uses: Nat.nth, Nat.Prime, Nat.nth_count, of_decide_eq_true, id, Bool, Decidable.decide, Bool.true, Eq.refl, Eq.mpr, HMod.hMod, HMul.hMul, congrArg

    7 instances, coercions and auxiliary constants left out.

    Tactic trace: 8 steps

    Open to load the checked before-and-after goal states.

  7. def OeisA182126.countA Count of occurrences of value $v$ among $a(1), \dots, a(x)$ line 75 source

    Source documentation

    Count of occurrences of value $v$ among $a(1), \dots, a(x)$.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: Finset.card, Finset.filter, And, LE.le, OfNat.ofNat, Eq, OeisA182126.a, Finset.range, HAdd.hAdd

    7 instances, coercions and auxiliary constants left out.

    noncomputable def countA (x v : ℕ) : ℕ :=
    …
  8. def OeisA182126.IsMostFrequent $v_0$ is a most frequent value among $a(1), \dots, a(x)$ line 79 source

    Source documentation

    $v_0$ is a most frequent value among $a(1), \dots, a(x)$.

    standard axioms: Classical.choice, Quot.sound, propext what this means

    Statement uses: Nat

    Proof uses: LE.le, OeisA182126.countA

    1 instances, coercions and auxiliary constants left out.

    def IsMostFrequent (x v₀ : ℕ) : Prop :=
    …
  9. theorem OeisA182126.conjecture1 Conjecture: For $x > 10^9$, the most frequent value in $a(n)$, $n=1\dots x$, has form $120k$ sorry line 86 source

    Source documentation

    Conjecture: For $x > 10^9$, the most frequent value in $a(n)$, $n=1\dots x$, has form $120k$.

    depends on sorry what this means

    Statement uses: Nat, LT.lt, HPow.hPow, OfNat.ofNat, OeisA182126.IsMostFrequent, Dvd.dvd

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    14 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem conjecture1 (x : ℕ) (hx : 10 ^ 9 < x) (v₀ : ℕ) (hv : IsMostFrequent x v₀) :
        120 ∣ v₀ := by
    …

    Mentions: OeisA182126.IsMostFrequent

  10. theorem OeisA182126.conjecture2 Let $b = \mathrm{prime}(n+2) - \mathrm{prime}(n)$ and $c = \mathrm{prime}(n+2) - \mathrm{prime}(n+1)$ sorry line 96 source

    Source documentation

    Let $b = \mathrm{prime}(n+2) - \mathrm{prime}(n)$ and $c = \mathrm{prime}(n+2) - \mathrm{prime}(n+1)$. Conjecture: for $n > 61$, $a(n) = b \cdot c$.

    • Charles R Greathouse IV, May 11 2012

    depends on sorry what this means

    Statement uses: Nat, LT.lt, OfNat.ofNat, HSub.hSub, OeisA182126.prime, HAdd.hAdd, Eq, OeisA182126.a, HMul.hMul

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    16 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem conjecture2 (n : ℕ) (hn : 61 < n) :
        let b := prime (n + 2) - prime n
    …

    Mentions: OeisA182126.prime

  11. theorem OeisA182126.conjecture3 Are 2, 7, 11, 13, 29 the only primes in this sequence? sorry line 107 source

    Source documentation

    Are 2, 7, 11, 13, 29 the only primes in this sequence?

    • Hugo Pfoertner, Sep 22 2025

    depends on sorry what this means

    Statement uses: Nat, LT.lt, OfNat.ofNat, Iff, Nat.Prime, OeisA182126.a, Membership.mem, List, List.cons, List.nil

    Proof uses: sorryAx, Lean.Name, Bool.false, Lean.Name.num, Lean.Name.str, Lean.Name.anonymous

    6 instances, coercions and auxiliary constants left out.

    Tactic trace: 1 steps

    Open to load the checked before-and-after goal states.

    theorem conjecture3 (n : ℕ) (hn : 0 < n) :
        (a n).Prime ↔ a n ∈ ([2, 7, 11, 13, 29] : List ℕ) := by
    …

    Mentions: OeisA182126.a