/- 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. -/ module public import FormalConjecturesUtil

Partitions $2n + 1 = x + y$ with $x^4 + y^4$ prime

For $n \ge 1$, $a(n)$ is the number of ways to write $2n + 1$ as $x + y$ with $0 < x < y$ such that $x^4 + y^4$ is prime.

References:

@[expose] public sectionnamespace OeisA218656

Number of ways to write $2n + 1$ as $x + y$ with $0 < x < y$ and $x^4 + y^4$ prime.

def a (n : ℕ) : ℕ := ∑ x ∈ Finset.Icc 1 n, if Nat.Prime (x ^ 4 + (2 * n + 1 - x) ^ 4) then 1 else 0@[category test, AMS 11] theorem a_1 : a 1 = 1 := ⊢ a 1 = 1 All goals completed! 🐙h1:Nat.Prime 257h2:Nat.Prime 97hIcc:Finset.Icc 1 2 = {1, 2}hcongr:(∑ x ∈ {1, 2}, if Nat.Prime (x ^ 4 + (2 * 2 + 1 - x) ^ 4) then 1 else 0) = ∑ x ∈ {1, 2}, 1⊢ ∑ x ∈ {1, 2}, 1 = 2 All goals completed! 🐙h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}hcongr:(∑ x ∈ {1, 2, 3}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = ∑ x ∈ {1, 2, 3}, 1⊢ ∑ x ∈ {1, 2, 3}, 1 = 3 All goals completed! 🐙h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}hcongr:(∑ x ∈ {1, 2, 3, 4}, if Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = ∑ x ∈ {1, 2, 3, 4}, if x = 2 ∨ x = 4 then 1 else 0⊢ (∑ x ∈ {1, 2, 3, 4}, if x = 2 ∨ x = 4 then 1 else 0) = 2 All goals completed! 🐙h1:¬Nat.Prime 10001h2:Nat.Prime 6577h3:Nat.Prime 4177h4:Nat.Prime 2657h5:¬Nat.Prime 1921hIcc:Finset.Icc 1 5 = {1, 2, 3, 4, 5}hcongr:(∑ x ∈ {1, 2, 3, 4, 5}, if Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = ∑ x ∈ {1, 2, 3, 4, 5}, if x = 2 ∨ x = 3 ∨ x = 4 then 1 else 0⊢ (∑ x ∈ {1, 2, 3, 4, 5}, if x = 2 ∨ x = 3 ∨ x = 4 then 1 else 0) = 3 All goals completed! 🐙

Conjecture: $a(n) > 0$ for all $n \ge 1$.

@[category research open, AMS 11] theorem conjecture_1 (n : ℕ) (hn : 1 ≤ n) : 0 < a n := n:ℕhn:1 ≤ n⊢ 0 < a n All goals completed! 🐙

Conjecture: If $x^4 + y^4$ in the definition of $a(n)$ is replaced by $x^2 + y^2$, then the count is positive for all $n \ge 1$.

    Thomas Ordowski, Nov 03 2012

@[category research open, AMS 11] theorem conjecture_2 (n : ℕ) (hn : 1 ≤ n) : ∃ x : ℕ, 1 ≤ x ∧ x ≤ n ∧ Nat.Prime (x ^ 2 + (2 * n + 1 - x) ^ 2) := n:ℕhn:1 ≤ n⊢ ∃ x, 1 ≤ x ∧ x ≤ n ∧ Nat.Prime (x ^ 2 + (2 * n + 1 - x) ^ 2) All goals completed! 🐙

Conjecture: If $x^4 + y^4$ in the definition of $a(n)$ is replaced by $x^8 + y^8$, then the count is positive for all $n \ge 1$ except for $2n + 1 \in {7, 9, 55, 73, 75, 105}$ (i.e., $n \in {3, 4, 27, 36, 37, 52}$).

    Thomas Ordowski, Nov 03 2012; exceptions noted by Mauro Fiorentini, Sep 22 2023

@[category research open, AMS 11] theorem conjecture_3 (n : ℕ) (hn : 1 ≤ n) (h_exc : n ∉ ({3, 4, 27, 36, 37, 52} : Set ℕ)) : ∃ x : ℕ, 1 ≤ x ∧ x ≤ n ∧ Nat.Prime (x ^ 8 + (2 * n + 1 - x) ^ 8) := n:ℕhn:1 ≤ nh_exc:n ∉ {3, 4, 27, 36, 37, 52}⊢ ∃ x, 1 ≤ x ∧ x ≤ n ∧ Nat.Prime (x ^ 8 + (2 * n + 1 - x) ^ 8) All goals completed! 🐙

Conjecture: If $x^4 + y^4$ in the definition of $a(n)$ is replaced by $x^{16} + y^{16}$, then the count is positive for all $n \ge 1$ except for $2n + 1 \in {5, 9}$ (i.e., $n \in {2, 4}$).

    Thomas Ordowski, Nov 03 2012; exceptions noted by Mauro Fiorentini, Sep 22 2023

@[category research open, AMS 11] theorem conjecture_4 (n : ℕ) (hn : 1 ≤ n) (h_exc : n ∉ ({2, 4} : Set ℕ)) : ∃ x : ℕ, 1 ≤ x ∧ x ≤ n ∧ Nat.Prime (x ^ 16 + (2 * n + 1 - x) ^ 16) := n:ℕhn:1 ≤ nh_exc:n ∉ {2, 4}⊢ ∃ x, 1 ≤ x ∧ x ≤ n ∧ Nat.Prime (x ^ 16 + (2 * n + 1 - x) ^ 16) All goals completed! 🐙end OeisA218656