/-
Copyright 2026 The Formal Conjectures Authors.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-/
import FormalConjecturesUtilCentral binomial sum $a(n) = \sum_{k=0}^n \binom{n}{k}^2 \binom{n-k}{k}^2 (-16)^k$
The sequence is defined by $$a(n) = \sum_{k=0}^n \binom{n}{k}^2 \binom{n-k}{k}^2 (-16)^k.$$
References:
Z.-W. Sun, "Open Conjectures on Congruences", arXiv preprint arXiv:0911.5665 [math.NT], 2009-2011.
namespace OeisA179537The sequence $a(n) = \sum_{k=0}^n \binom{n}{k}^2 \binom{n-k}{k}^2 (-16)^k$.
def a (n : ℕ) : ℤ :=
∑ k ∈ Finset.range (n + 1), (n.choose k : ℤ) ^ 2 * ((n - k).choose k : ℤ) ^ 2 * (-16 : ℤ) ^ k
Value of the sequence a at 0.
@[category test, AMS 11]
theorem a_0 : a 0 = 1 := ⊢ a 0 = 1 All goals completed! 🐙
Value of the sequence a at 1.
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := ⊢ a 1 = 1 All goals completed! 🐙
Value of the sequence a at 2.
@[category test, AMS 11]
theorem a_2 : a 2 = -63 := ⊢ a 2 = -63 All goals completed! 🐙
Value of the sequence a at 3.
@[category test, AMS 11]
theorem a_3 : a 3 = -575 := ⊢ a 3 = -575 All goals completed! 🐙
Value of the sequence a at 4.
@[category test, AMS 11]
theorem a_4 : a 4 = 6913 := ⊢ a 4 = 6913 All goals completed! 🐙If $p$ is a prime with $(p/7) = 1$ and $p = x^2 + 7y^2$ with $x, y$ integers, then $\sum_{k=0}^{p-1} (-1)^k a(k) \equiv 4x^2 - 2p \pmod{p^2}$.
Zhi-Wei Sun, Jul 17 2010
@[category research open, AMS 11]
theorem conjecture1 (p : ℕ) [Fact p.Prime] (hp7 : p ≠ 7)
(h_leg : letI : Fact (Nat.Prime 7) := ⟨p:ℕinst✝:Fact (Nat.Prime p)hp7:p ≠ 7⊢ Nat.Prime 7 All goals completed! 🐙⟩; legendreSym 7 p = 1)
(x y : ℤ) (h_sq : (p : ℤ) = x ^ 2 + 7 * y ^ 2) :
(∑ k ∈ Finset.range p, (-1 : ℤ) ^ k * a k) ≡
4 * x ^ 2 - 2 * (p : ℤ) [ZMOD (p : ℤ) ^ 2] := p:ℕinst✝:Fact (Nat.Prime p)hp7:p ≠ 7h_leg:legendreSym 7 ↑p = 1x:ℤy:ℤh_sq:↑p = x ^ 2 + 7 * y ^ 2⊢ ∑ k ∈ Finset.range p, (-1) ^ k * a k ≡ 4 * x ^ 2 - 2 * ↑p [ZMOD ↑p ^ 2]
All goals completed! 🐙If $p$ is a prime with $(p/7) = -1$, then $\sum_{k=0}^{p-1} (-1)^k a(k) \equiv 0 \pmod{p^2}$.
Zhi-Wei Sun, Jul 17 2010
@[category research open, AMS 11]
theorem conjecture2 (p : ℕ) [Fact p.Prime] (hp7 : p ≠ 7)
(h_leg : letI : Fact (Nat.Prime 7) := ⟨p:ℕinst✝:Fact (Nat.Prime p)hp7:p ≠ 7⊢ Nat.Prime 7 All goals completed! 🐙⟩; legendreSym 7 p = -1) :
(∑ k ∈ Finset.range p, (-1 : ℤ) ^ k * a k) ≡ 0 [ZMOD (p : ℤ) ^ 2] := p:ℕinst✝:Fact (Nat.Prime p)hp7:p ≠ 7h_leg:legendreSym 7 ↑p = -1⊢ ∑ k ∈ Finset.range p, (-1) ^ k * a k ≡ 0 [ZMOD ↑p ^ 2]
All goals completed! 🐙$\sum_{k=0}^{n-1} (42k + 37) (-1)^k a(k) \equiv 0 \pmod n$ for all $n \ge 1$.
Zhi-Wei Sun, Jul 17 2010
@[category research open, AMS 11]
theorem conjecture3 (n : ℕ) (hn : 1 ≤ n) :
(n : ℤ) ∣ ∑ k ∈ Finset.range n, ((42 * (k : ℤ) + 37) * (-1 : ℤ) ^ k * a k) := n:ℕhn:1 ≤ n⊢ ↑n ∣ ∑ k ∈ Finset.range n, (42 * ↑k + 37) * (-1) ^ k * a k
All goals completed! 🐙$\sum_{k=0}^{p-1} (42k + 37) (-1)^k a(k) \equiv p(21(p/7) + 16) \pmod{p^2}$ for any prime $p \ne 7$.
Zhi-Wei Sun, Jul 17 2010
@[category research open, AMS 11]
theorem conjecture4 (p : ℕ) [Fact p.Prime] (_hp7 : p ≠ 7) :
letI : Fact (Nat.Prime 7) := ⟨p:ℕinst✝:Fact (Nat.Prime p)_hp7:p ≠ 7⊢ Nat.Prime 7 All goals completed! 🐙⟩
(∑ k ∈ Finset.range p, ((42 * (k : ℤ) + 37) * (-1 : ℤ) ^ k * a k)) ≡
(p : ℤ) * (21 * legendreSym 7 p + 16) [ZMOD (p : ℤ) ^ 2] := p:ℕinst✝:Fact (Nat.Prime p)_hp7:p ≠ 7⊢ ∑ k ∈ Finset.range p, (42 * ↑k + 37) * (-1) ^ k * a k ≡ ↑p * (21 * legendreSym 7 ↑p + 16) [ZMOD ↑p ^ 2]
All goals completed! 🐙end OeisA179537