{
  "id": "6449",
  "ident": "NS.06449",
  "slug": "oeis-381355",
  "title": "A logarithmic derivative with prime-divisible coefficients",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "\"Conjecture: $a(n)$ is divisible by $\\operatorname{prime}(n)$ for $n > 1$.\"\n- Paul D. Hanna, Mar 11 2025.\n\nProved and formalized in Lean by Wentao Li, with AI assistance; see [Li26].",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [
    "formal_proof"
  ],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA381355.conjecture",
  "statement_lean": "theorem conjecture (n : ℕ) (hn : 1 < n) : (primeN n : ℤ) ∣ a n",
  "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# A logarithmic derivative with prime-divisible coefficients\n\nLet $F(x)$ be the generating function of A381353, with $F(0)=1$, $[x]F(x)=1$, and\n$[x^n]F(x)^{p_n}=0$ for $n>1$, where $p_n$ is the $n$-th prime.\nThe sequence is defined by $\\sum_{n\\ge1}a(n)x^n=xF'(x)/F(x)$.\n\n*References:*\n- [A381355](https://oeis.org/A381355)\n- [A381353](https://oeis.org/A381353)\n- [Li26] Wentao Li, [Prime divisibility of logarithmic-derivative coefficients](https://github.com/VictorLiwentao/lean-oeis-proofs/blob/0a23974e54b90afd1453ef02c27cf8f617bad940/proofs/new-proofs/A381355/PROOF.md), 2026.\n-/\n\n@[expose] public section\n\nnamespace OeisA381355\n\nopen PowerSeries\n\n/-- The $n$-th prime, indexed from $p_1=2$. -/\nnoncomputable def primeN (n : ℕ) : ℕ := Nat.nth Nat.Prime (n - 1)\n\n/-- The coefficients of $F$, obtained successively from $[x^n]F(x)^{p_n}=0$. -/\nnoncomputable def f : ℕ → ℤ :=\n  Nat.strongRec fun n ih =>\n    if n = 0 then 1\n    else if n = 1 then 1\n    else\n      -(coeff n\n          (PowerSeries.mk (fun k => if h : k < n then ih k h else 0) ^ primeN n) /\n        (primeN n : ℤ))\n\n/-- The generating function of A381353. -/\nnoncomputable def series : PowerSeries ℤ := PowerSeries.mk f\n\n/-- The coefficients of $xF'(x)/F(x)$. -/\nnoncomputable def a (n : ℕ) : ℤ :=\n  coeff n (X * derivative ℤ series * invOfUnit series 1)\n\n@[category API, AMS 11]\nprivate lemma f_eq (n : ℕ) :\n    f n = if n = 0 then 1 else if n = 1 then 1 else\n      -(coeff n (PowerSeries.mk (fun k => if k < n then f k else 0) ^ primeN n) /\n        (primeN n : ℤ)) := by\n  rw [f, Nat.strongRec_eq]\n  rfl\n\n@[category API, AMS 11]\nprivate lemma f_0 : f 0 = 1 := by rw [f_eq]; norm_num\n@[category API, AMS 11]\nprivate lemma f_1 : f 1 = 1 := by rw [f_eq]; norm_num\n\n@[category API, AMS 11]\nprivate lemma coeff_mul_range (n : ℕ) (F G : PowerSeries ℤ) :\n    coeff n (F * G) = ∑ k ∈ Finset.range (n + 1), coeff k F * coeff (n - k) G := by\n  rw [coeff_mul, Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk]\n\n@[category API, AMS 11]\nprivate lemma coeff_pow_succ (n p : ℕ) (G : PowerSeries ℤ) :\n    coeff n (G ^ (p + 1)) =\n      ∑ k ∈ Finset.range (n + 1), coeff k (G ^ p) * coeff (n - k) G := by\n  rw [pow_succ, coeff_mul_range]\n\n@[category API, AMS 11]\nprivate lemma f_2 : f 2 = -1 := by\n  rw [f_eq]\n  norm_num [primeN, Nat.nth_prime_one_eq_three, coeff_pow_succ,\n    Finset.sum_range_succ, coeff_mk, coeff_one, f_0, f_1]\n\n@[category API, AMS 11]\nprivate lemma f_3 : f 3 = 2 := by\n  rw [f_eq]\n  norm_num [primeN, Nat.nth_prime_two_eq_five, coeff_pow_succ,\n    Finset.sum_range_succ, coeff_mk, coeff_one, f_0, f_1, f_2]\n\n@[category API, AMS 11]\nprivate lemma coeff_natCast (n k : ℕ) :\n    coeff n (k : PowerSeries ℤ) = if n = 0 then (k : ℤ) else 0 := by\n  have h : (k : PowerSeries ℤ) = C (k : ℤ) := by simp\n  rw [h, coeff_C]\n\n@[category API, AMS 11]\nprivate lemma coeff_natCast_mul (n k : ℕ) (G : PowerSeries ℤ) :\n    coeff n ((k : PowerSeries ℤ) * G) = (k : ℤ) * coeff n G := by\n  have h : (k : PowerSeries ℤ) = C (k : ℤ) := by simp\n  rw [h, coeff_C_mul]\n\n@[category API, AMS 11]\nprivate lemma coeff_ofNat (n k : ℕ) [k.AtLeastTwo] :\n    coeff n (ofNat(k) : PowerSeries ℤ) = if n = 0 then (ofNat(k) : ℤ) else 0 := by\n  exact coeff_natCast n k\n\n@[category API, AMS 11]\nprivate lemma coeff_ofNat_mul (n k : ℕ) [k.AtLeastTwo] (G : PowerSeries ℤ) :\n    coeff n ((ofNat(k) : PowerSeries ℤ) * G) = (ofNat(k) : ℤ) * coeff n G := by\n  exact coeff_natCast_mul n k G\n\n@[category API, AMS 11]\nprivate lemma f_4 : f 4 = -5 := by\n  have ht : PowerSeries.mk (fun k => if k < 4 then f k else 0) =\n      (1 + X - X ^ 2 + 2 * X ^ 3 : PowerSeries ℤ) := by\n    ext n\n    by_cases hn : n < 4\n    · interval_cases n <;>\n        norm_num [coeff_mk, f_0, f_1, f_2, f_3, coeff_X_pow, coeff_X, coeff_ofNat_mul]\n    · have h0 : n ≠ 0 := by omega\n      have h1 : n ≠ 1 := by omega\n      have h2 : n ≠ 2 := by omega\n      have h3 : n ≠ 3 := by omega\n      simp [coeff_mk, hn, coeff_X_pow, h0, h1, h2, h3, coeff_X, coeff_ofNat_mul]\n  rw [f_eq]\n  norm_num only [primeN, Nat.reduceSub, Nat.nth_prime_three_eq_seven, Nat.cast_ofNat,\n    show (4 : ℕ) ≠ 0 from by decide, show (4 : ℕ) ≠ 1 from by decide, if_false]\n  rw [ht]\n  ring_nf\n  norm_num [map_add, coeff_mul, coeff_X_pow, coeff_X, coeff_ofNat, map_ofNat,\n    Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk, Finset.sum_range_succ]\n\n@[category API, AMS 11]\nprivate lemma f_5 : f 5 = 13 := by\n  have ht : PowerSeries.mk (fun k => if k < 5 then f k else 0) =\n      (1 + X - X ^ 2 + 2 * X ^ 3 - 5 * X ^ 4 : PowerSeries ℤ) := by\n    ext n\n    by_cases hn : n < 5\n    · interval_cases n <;>\n        norm_num [coeff_mk, f_0, f_1, f_2, f_3, f_4, coeff_X_pow, coeff_X, coeff_ofNat_mul]\n    · have h0 : n ≠ 0 := by omega\n      have h1 : n ≠ 1 := by omega\n      have h2 : n ≠ 2 := by omega\n      have h3 : n ≠ 3 := by omega\n      have h4 : n ≠ 4 := by omega\n      simp [coeff_mk, hn, coeff_X_pow, h0, h1, h2, h3, h4, coeff_X, coeff_ofNat_mul]\n  rw [f_eq]\n  norm_num only [primeN, Nat.reduceSub, Nat.nth_prime_four_eq_eleven, Nat.cast_ofNat,\n    show (5 : ℕ) ≠ 0 from by decide, show (5 : ℕ) ≠ 1 from by decide, if_false]\n  rw [ht]\n  ring_nf\n  norm_num [map_add, coeff_mul, coeff_X_pow, coeff_X, coeff_ofNat, map_ofNat,\n    Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk, Finset.sum_range_succ]\n\n@[category API, AMS 11]\nprivate lemma inv_coeff (n : ℕ) :\n    coeff n (invOfUnit series 1) = if n = 0 then 1 else\n      -∑ k ∈ Finset.range (n + 1),\n        if n - k < n then f k * coeff (n - k) (invOfUnit series 1) else 0 := by\n  rw [coeff_invOfUnit]\n  simp only [inv_one, Units.val_one, neg_one_mul, series, coeff_mk,\n    Finset.Nat.sum_antidiagonal_eq_sum_range_succ_mk]\n\n@[category API, AMS 11]\nprivate lemma inv_0 : coeff 0 (invOfUnit series 1) = 1 := by\n  rw [inv_coeff]\n  norm_num [Finset.sum_range_succ, f_0]\n\n@[category API, AMS 11]\nprivate lemma inv_1 : coeff 1 (invOfUnit series 1) = -1 := by\n  rw [inv_coeff]\n  norm_num [Finset.sum_range_succ, f_0, f_1, inv_0]\n\n@[category API, AMS 11]\nprivate lemma inv_2 : coeff 2 (invOfUnit series 1) = 2 := by\n  rw [inv_coeff]\n  norm_num [Finset.sum_range_succ, f_0, f_1, f_2, inv_0, inv_1]\n\n@[category API, AMS 11]\nprivate lemma inv_3 : coeff 3 (invOfUnit series 1) = -5 := by\n  rw [inv_coeff]\n  norm_num [Finset.sum_range_succ, f_0, f_1, f_2, f_3, inv_0, inv_1, inv_2]\n\n@[category API, AMS 11]\nprivate lemma inv_4 : coeff 4 (invOfUnit series 1) = 14 := by\n  rw [inv_coeff]\n  norm_num [Finset.sum_range_succ, f_0, f_1, f_2, f_3, f_4, inv_0, inv_1, inv_2, inv_3]\n\n@[category API, AMS 11]\nprivate lemma a_succ (n : ℕ) :\n    a (n + 1) = ∑ k ∈ Finset.range (n + 1),\n      (f (k + 1) * (k + 1)) * coeff (n - k) (invOfUnit series 1) := by\n  rw [a, mul_assoc, coeff_succ_X_mul, coeff_mul_range]\n  simp only [coeff_derivative, series, coeff_mk]\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 1 := by\n  rw [show 1 = 0 + 1 from rfl, a_succ]\n  norm_num [Finset.sum_range_succ, inv_0, inv_1, inv_2, inv_3, inv_4, f_0, f_1]\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = -3 := by\n  rw [show 2 = 1 + 1 from rfl, a_succ]\n  norm_num [Finset.sum_range_succ, inv_0, inv_1, inv_2, inv_3, inv_4, f_0, f_1, f_2]\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 10 := by\n  rw [show 3 = 2 + 1 from rfl, a_succ]\n  norm_num [Finset.sum_range_succ, inv_0, inv_1, inv_2, inv_3, inv_4, f_0, f_1, f_2, f_3]\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = -35 := by\n  rw [show 4 = 3 + 1 from rfl, a_succ]\n  norm_num [Finset.sum_range_succ, inv_0, inv_1, inv_2, inv_3, inv_4, f_0, f_1, f_2, f_3, f_4]\n\n@[category test, AMS 11]\ntheorem a_5 : a 5 = 121 := by\n  rw [show 5 = 4 + 1 from rfl, a_succ]\n  norm_num [Finset.sum_range_succ, inv_0, inv_1, inv_2, inv_3, inv_4, f_0, f_1, f_2, f_3, f_4, f_5]\n\nset_option linter.style.formal_proof_palomar false in\n/--\n\"Conjecture: $a(n)$ is divisible by $\\operatorname{prime}(n)$ for $n > 1$.\"\n- Paul D. Hanna, Mar 11 2025.\n\nProved and formalized in Lean by Wentao Li, with AI assistance; see [Li26].\n-/\n@[category research solved, AMS 11,\n  formal_proof using lean4 at \"https://github.com/VictorLiwentao/lean-oeis-proofs/blob/0a23974e54b90afd1453ef02c27cf8f617bad940/LeanOeisProofs/NewProofs/A381355.lean#L380\"]\ntheorem conjecture (n : ℕ) (hn : 1 < n) : (primeN n : ℤ) ∣ a n := by\n  sorry\n\nend OeisA381355\n",
  "statement_hash": "8b5f10d921dc27dea5b54377d9092745802ca1148ce5c9b82e04eac027bad430",
  "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."
}