{
  "id": "5099",
  "ident": "NS.05099",
  "slug": "oeis-1818--conjecture2",
  "title": "Squares of double factorials · conjecture2",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Conjecture 2: Let $p$ be an odd prime. Then the permanent of the $(p-1) \\times (p-1)$ matrix\n$[f(j,k)]_{j,k=1..p-1}$ is congruent to $a((p-1)/2) = ((p-2)!!)^2 \\pmod{p^2}$,\nwhere $f(j,k)$ is $(j+k)/(j-k)$ if $j \\neq k$, and $f(j,k) = 1$ otherwise.\n- Zhi-Wei Sun, Dec 22 2021",
  "subjects": [
    "math.NT",
    "math.RA",
    "msc:11",
    "msc:15"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA1818.conjecture2",
  "statement_lean": "theorem conjecture2 {p : ℕ} (hp : p.Prime) (h_odd : p ≠ 2) :\n    let N : ℕ := p - 1\n    let R := ZMod (p ^ 2)\n    let Idx := Fin N\n    let M : Matrix Idx Idx R := fun i j => fEntry (i.val + 1) (j.val + 1)\n    (M.permanent : R) = (a ((p - 1) / 2) : R)",
  "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# Squares of double factorials\n\nSquares of double factorials: $a(n) = ((2n-1)!!)^2 = (1 \\cdot 3 \\cdot 5 \\cdots (2n-1))^2$.\n\n*References:*\n- [A001818](https://oeis.org/A001818)\n- [She, Sun, Xia, *A novel permanent identity with applications*, Theorem 1.3(ii)](https://arxiv.org/abs/2208.12167)\n- [Yang, Zhang, *Sun-type determinant and permanent congruences*, Proposition 17](https://arxiv.org/abs/2605.19502)\n-/\n\n@[expose] public section\n\nnamespace OeisA1818\n\n/-- The sequence of squares of double factorials: $a(n) = ((2n-1)!!)^2$. -/\ndef a (n : ℕ) : ℕ :=\n  (∏ k ∈ Finset.range n, (2 * k + 1)) ^ 2\n\n/-- Value of the sequence `a` at 0. -/\n@[category test, AMS 11]\ntheorem a_0 : a 0 = 1 := by decide\n\n/-- Value of the sequence `a` at 1. -/\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 1 := by decide\n\n/-- Value of the sequence `a` at 2. -/\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 9 := by decide\n\n/-- Value of the sequence `a` at 3. -/\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 225 := by decide\n\n/-- Value of the sequence `a` at 4. -/\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 11025 := by decide\n\n/-- Characteristic function $f(j, k)$ for matrix entries in $\\mathbb{Z}/p^2\\mathbb{Z}$. -/\nnoncomputable def fEntry {p : ℕ} (i j : ℕ) : ZMod (p ^ 2) :=\n  let R := ZMod (p ^ 2)\n  if i = j then\n    1\n  else\n    let iInt : ℤ := i\n    let jInt : ℤ := j\n    let num : R := (iInt + jInt : ℤ)\n    let den : R := (iInt - jInt : ℤ)\n    num * den⁻¹\n\nset_option linter.style.formal_proof_palomar false in\n/--\nConjecture 1: For any primitive $2n$-th root $\\zeta$ of unity, the permanent of the $2n \\times 2n$\nmatrix $[m(j,k)]_{j,k=1..2n}$ coincides with $a(n) = ((2n-1)!!)^2$, where $m(j,k)$ is\n$(1+\\zeta^{j-k})/(1-\\zeta^{j-k})$ if $j \\neq k$, and $1$ otherwise.\n- Zhi-Wei Sun, Dec 21 2021\n\nProved by She, Sun and Xia, Theorem 1.3(ii) in the reference above.\nLean formalization by Wentao Li, with AI assistance.\n-/\n@[category research solved, AMS 11 15,\n  formal_proof using lean4 at \"https://github.com/VictorLiwentao/lean-oeis-proofs/blob/0a23974e54b90afd1453ef02c27cf8f617bad940/LeanOeisProofs/NewFormalization/A001818.lean#L7753\"]\ntheorem conjecture1 (n : ℕ) (hn : 1 ≤ n) :\n    ∀ (ζ : ℂ), IsPrimitiveRoot ζ (2 * n) →\n      Matrix.permanent (fun (i j : Fin (2 * n)) =>\n        if i = j then\n          (1 : ℂ)\n        else\n          (1 + ζ ^ (i.val - j.val : ℤ)) / (1 - ζ ^ (i.val - j.val : ℤ))\n      ) = (a n : ℂ) := by\n  sorry\n\n/--\nConjecture 2: Let $p$ be an odd prime. Then the permanent of the $(p-1) \\times (p-1)$ matrix\n$[f(j,k)]_{j,k=1..p-1}$ is congruent to $a((p-1)/2) = ((p-2)!!)^2 \\pmod{p^2}$,\nwhere $f(j,k)$ is $(j+k)/(j-k)$ if $j \\neq k$, and $f(j,k) = 1$ otherwise.\n- Zhi-Wei Sun, Dec 22 2021\n-/\n@[category research solved, AMS 11 15]\ntheorem conjecture2 {p : ℕ} (hp : p.Prime) (h_odd : p ≠ 2) :\n    let N : ℕ := p - 1\n    let R := ZMod (p ^ 2)\n    let Idx := Fin N\n    let M : Matrix Idx Idx R := fun i j => fEntry (i.val + 1) (j.val + 1)\n    (M.permanent : R) = (a ((p - 1) / 2) : R) := by\n  sorry\n\nend OeisA1818\n",
  "statement_hash": "638c59f38fdf130359aa90da6902a1fecfbcbf2192b919420e420f77605d39bd",
  "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."
}