{
  "id": "5105",
  "ident": "NS.05105",
  "slug": "oeis-182126--conjecture2",
  "title": "Product of two consecutive primes modulo the next prime · conjecture2",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Let $b = \\mathrm{prime}(n+2) - \\mathrm{prime}(n)$ and $c = \\mathrm{prime}(n+2) - \\mathrm{prime}(n+1)$.\nConjecture: for $n > 61$, $a(n) = b \\cdot c$.\n- _Charles R Greathouse IV_, May 11 2012",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA182126.conjecture2",
  "statement_lean": "theorem conjecture2 (n : ℕ) (hn : 61 < n) :\n    let b := prime (n + 2) - prime n\n    let c := prime (n + 2) - prime (n + 1)\n    a n = b * c",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# Product of two consecutive primes modulo the next prime\n\nThe sequence is defined by\n$$a(n) = \\mathrm{prime}(n) \\cdot \\mathrm{prime}(n+1) \\bmod \\mathrm{prime}(n+2),$$\nwhere $\\mathrm{prime}(k)$ is the $k$-th prime number ($\\mathrm{prime}(1)=2$).\n\n*References:*\n- [A182126](https://oeis.org/A182126)-/\n\n@[expose] public section\n\nnamespace OeisA182126\n\n/-- $\\mathrm{prime}(k)$ is the $k$-th prime number ($\\mathrm{prime}(1) = 2$). -/\nnoncomputable def prime (k : ℕ) : ℕ := Nat.nth Nat.Prime (k - 1)\n\n/-- $a(n) = \\mathrm{prime}(n) \\cdot \\mathrm{prime}(n+1) \\bmod \\mathrm{prime}(n+2)$. -/\nnoncomputable def a (n : ℕ) : ℕ :=\n  if n = 0 then 0\n  else (prime n * prime (n + 1)) % prime (n + 2)\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 1 := by\n  have h0 : Nat.nth Nat.Prime 0 = 2 := (2).nth_count (by decide : (2).Prime)\n  have h1 : Nat.nth Nat.Prime 1 = 3 := (3).nth_count (by decide : (3).Prime)\n  have h2 : Nat.nth Nat.Prime 2 = 5 := (5).nth_count (by decide : (5).Prime)\n  show (Nat.nth Nat.Prime 0 * Nat.nth Nat.Prime 1) % Nat.nth Nat.Prime 2 = 1\n  rw [h0, h1, h2]\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 1 := by\n  have h1 : Nat.nth Nat.Prime 1 = 3 := (3).nth_count (by decide : (3).Prime)\n  have h2 : Nat.nth Nat.Prime 2 = 5 := (5).nth_count (by decide : (5).Prime)\n  have h3 : Nat.nth Nat.Prime 3 = 7 := (7).nth_count (by decide : (7).Prime)\n  show (Nat.nth Nat.Prime 1 * Nat.nth Nat.Prime 2) % Nat.nth Nat.Prime 3 = 1\n  rw [h1, h2, h3]\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 2 := by\n  have h2 : Nat.nth Nat.Prime 2 = 5 := (5).nth_count (by decide : (5).Prime)\n  have h3 : Nat.nth Nat.Prime 3 = 7 := (7).nth_count (by decide : (7).Prime)\n  have h4 : Nat.nth Nat.Prime 4 = 11 := (11).nth_count (by decide : (11).Prime)\n  show (Nat.nth Nat.Prime 2 * Nat.nth Nat.Prime 3) % Nat.nth Nat.Prime 4 = 2\n  rw [h2, h3, h4]\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 12 := by\n  have h3 : Nat.nth Nat.Prime 3 = 7 := (7).nth_count (by decide : (7).Prime)\n  have h4 : Nat.nth Nat.Prime 4 = 11 := (11).nth_count (by decide : (11).Prime)\n  have h5 : Nat.nth Nat.Prime 5 = 13 := (13).nth_count (by decide : (13).Prime)\n  show (Nat.nth Nat.Prime 3 * Nat.nth Nat.Prime 4) % Nat.nth Nat.Prime 5 = 12\n  rw [h3, h4, h5]\n\n/-- Count of occurrences of value $v$ among $a(1), \\dots, a(x)$. -/\nnoncomputable def countA (x v : ℕ) : ℕ :=\n  ((Finset.range (x + 1)).filter fun n => 1 ≤ n ∧ a n = v).card\n\n/-- $v_0$ is a most frequent value among $a(1), \\dots, a(x)$. -/\ndef IsMostFrequent (x v₀ : ℕ) : Prop :=\n  ∀ v : ℕ, countA x v ≤ countA x v₀\n\n/--\nConjecture: For $x > 10^9$, the most frequent value in $a(n)$, $n=1\\dots x$, has form $120k$.\n-/\n@[category research open, AMS 11]\ntheorem conjecture1 (x : ℕ) (hx : 10 ^ 9 < x) (v₀ : ℕ) (hv : IsMostFrequent x v₀) :\n    120 ∣ v₀ := by\n  sorry\n\n/--\nLet $b = \\mathrm{prime}(n+2) - \\mathrm{prime}(n)$ and $c = \\mathrm{prime}(n+2) - \\mathrm{prime}(n+1)$.\nConjecture: for $n > 61$, $a(n) = b \\cdot c$.\n- _Charles R Greathouse IV_, May 11 2012\n-/\n@[category research open, AMS 11]\ntheorem conjecture2 (n : ℕ) (hn : 61 < n) :\n    let b := prime (n + 2) - prime n\n    let c := prime (n + 2) - prime (n + 1)\n    a n = b * c := by\n  sorry\n\n/--\nAre 2, 7, 11, 13, 29 the only primes in this sequence?\n- _Hugo Pfoertner_, Sep 22 2025\n-/\n@[category research open, AMS 11]\ntheorem conjecture3 (n : ℕ) (hn : 0 < n) :\n    (a n).Prime ↔ a n ∈ ([2, 7, 11, 13, 29] : List ℕ) := by\n  sorry\n\nend OeisA182126\n",
  "statement_hash": "f0e40ee8996ca55a47c4c90759825af5648b45a55432ca5d902e59cfdf0ba4bc",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}