/-
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 FormalConjecturesUtilPartitions $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 OeisA218656Number 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
decide All goals completed! 🐙
@[category test, AMS 11]
theorem a_3 : a 3 = 3 := by ⊢ a 3 = 3
have h1 : Nat.Prime 1297 := by norm_num h1:Nat.Prime 1297⊢ a 3 = 3 h1:Nat.Prime 1297⊢ a 3 = 3
have h2 : Nat.Prime 641 := by norm_num h1:Nat.Prime 1297h2:Nat.Prime 641⊢ a 3 = 3 h1:Nat.Prime 1297h2:Nat.Prime 641⊢ a 3 = 3
have h3 : Nat.Prime 337 := by norm_num h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337⊢ a 3 = 3 h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337⊢ a 3 = 3
have hIcc : Finset.Icc 1 3 = ({1, 2, 3} : Finset ℕ) := by decide h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ a 3 = 3 h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ a 3 = 3
rw [a, h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (∑ x ∈ Finset.Icc 1 3, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3 h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (∑ x ∈ {1, 2, 3}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3 hIcc h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (∑ x ∈ {1, 2, 3}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3 h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (∑ x ∈ {1, 2, 3}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3] h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (∑ x ∈ {1, 2, 3}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3
have hcongr :
(∑ x ∈ ({1, 2, 3} : Finset ℕ),
if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) =
∑ x ∈ ({1, 2, 3} : Finset ℕ), 1 := by ⊢ a 3 = 3 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}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3
refine Finset.sum_congr rfl fun x hx => ?_ h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}x:ℕhx:x ∈ {1, 2, 3}⊢ (if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 1 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}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3
fin_cases hx «0» h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (if Nat.Prime (1 ^ 4 + (2 * 3 + 1 - 1) ^ 4) then 1 else 0) = 1«1» h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (if Nat.Prime (2 ^ 4 + (2 * 3 + 1 - 2) ^ 4) then 1 else 0) = 1«2» h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (if Nat.Prime (3 ^ 4 + (2 * 3 + 1 - 3) ^ 4) then 1 else 0) = 1 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}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3 <;> «0» h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (if Nat.Prime (1 ^ 4 + (2 * 3 + 1 - 1) ^ 4) then 1 else 0) = 1«1» h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (if Nat.Prime (2 ^ 4 + (2 * 3 + 1 - 2) ^ 4) then 1 else 0) = 1«2» h1:Nat.Prime 1297h2:Nat.Prime 641h3:Nat.Prime 337hIcc:Finset.Icc 1 3 = {1, 2, 3}⊢ (if Nat.Prime (3 ^ 4 + (2 * 3 + 1 - 3) ^ 4) then 1 else 0) = 1 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}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3 simp [h1, h2, h3] 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}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3 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}, if Nat.Prime (x ^ 4 + (2 * 3 + 1 - x) ^ 4) then 1 else 0) = 3
rw [hcongr 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 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] 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
decide All goals completed! 🐙
@[category test, AMS 11]
theorem a_4 : a 4 = 2 := by ⊢ a 4 = 2
have h1 : ¬ Nat.Prime 4097 := by norm_num h1:¬Nat.Prime 4097⊢ a 4 = 2 h1:¬Nat.Prime 4097⊢ a 4 = 2
have h2 : Nat.Prime 2417 := by norm_num h1:¬Nat.Prime 4097h2:Nat.Prime 2417⊢ a 4 = 2 h1:¬Nat.Prime 4097h2:Nat.Prime 2417⊢ a 4 = 2
have h3 : ¬ Nat.Prime 1377 := by norm_num h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377⊢ a 4 = 2 h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377⊢ a 4 = 2
have h4 : Nat.Prime 881 := by norm_num h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881⊢ a 4 = 2 h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881⊢ a 4 = 2
have hIcc : Finset.Icc 1 4 = ({1, 2, 3, 4} : Finset ℕ) := by decide h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ a 4 = 2 h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ a 4 = 2
rw [a, h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (∑ x ∈ Finset.Icc 1 4, if Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (∑ x ∈ {1, 2, 3, 4}, if Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 hIcc h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (∑ x ∈ {1, 2, 3, 4}, if Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (∑ x ∈ {1, 2, 3, 4}, if Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2] h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (∑ x ∈ {1, 2, 3, 4}, if Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2
have hcongr :
(∑ x ∈ ({1, 2, 3, 4} : Finset ℕ),
if Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) =
∑ x ∈ ({1, 2, 3, 4} : Finset ℕ), if x = 2 ∨ x = 4 then 1 else 0 := by ⊢ a 4 = 2 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2
refine Finset.sum_congr rfl fun x hx => ?_ h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}x:ℕhx:x ∈ {1, 2, 3, 4}⊢ (if Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = if x = 2 ∨ x = 4 then 1 else 0 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2
fin_cases hx «0» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (if Nat.Prime (1 ^ 4 + (2 * 4 + 1 - 1) ^ 4) then 1 else 0) = if 1 = 2 ∨ 1 = 4 then 1 else 0«1» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (if Nat.Prime (2 ^ 4 + (2 * 4 + 1 - 2) ^ 4) then 1 else 0) = if 2 = 2 ∨ 2 = 4 then 1 else 0«2» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (if Nat.Prime (3 ^ 4 + (2 * 4 + 1 - 3) ^ 4) then 1 else 0) = if 3 = 2 ∨ 3 = 4 then 1 else 0«3» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (if Nat.Prime (4 ^ 4 + (2 * 4 + 1 - 4) ^ 4) then 1 else 0) = if 4 = 2 ∨ 4 = 4 then 1 else 0 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 <;> «0» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (if Nat.Prime (1 ^ 4 + (2 * 4 + 1 - 1) ^ 4) then 1 else 0) = if 1 = 2 ∨ 1 = 4 then 1 else 0«1» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (if Nat.Prime (2 ^ 4 + (2 * 4 + 1 - 2) ^ 4) then 1 else 0) = if 2 = 2 ∨ 2 = 4 then 1 else 0«2» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (if Nat.Prime (3 ^ 4 + (2 * 4 + 1 - 3) ^ 4) then 1 else 0) = if 3 = 2 ∨ 3 = 4 then 1 else 0«3» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ (if Nat.Prime (4 ^ 4 + (2 * 4 + 1 - 4) ^ 4) then 1 else 0) = if 4 = 2 ∨ 4 = 4 then 1 else 0 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 simp «3» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ Nat.Prime 881 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 <;> «0» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ ¬Nat.Prime 4097«1» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ Nat.Prime 2417«2» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ ¬Nat.Prime 1377«3» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ Nat.Prime 881 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 first | exact h1 «3» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ Nat.Prime 881 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 | exact h2 «3» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ Nat.Prime 881 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 | exact h3 «3» h1:¬Nat.Prime 4097h2:Nat.Prime 2417h3:¬Nat.Prime 1377h4:Nat.Prime 881hIcc:Finset.Icc 1 4 = {1, 2, 3, 4}⊢ Nat.Prime 881 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 | exact h4 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2 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 Nat.Prime (x ^ 4 + (2 * 4 + 1 - x) ^ 4) then 1 else 0) = 2
rw [hcongr 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 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] 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
decide All goals completed! 🐙
@[category test, AMS 11]
theorem a_5 : a 5 = 3 := by ⊢ a 5 = 3
have h1 : ¬ Nat.Prime 10001 := by norm_num h1:¬Nat.Prime 10001⊢ a 5 = 3 h1:¬Nat.Prime 10001⊢ a 5 = 3
have h2 : Nat.Prime 6577 := by norm_num h1:¬Nat.Prime 10001h2:Nat.Prime 6577⊢ a 5 = 3 h1:¬Nat.Prime 10001h2:Nat.Prime 6577⊢ a 5 = 3
have h3 : Nat.Prime 4177 := by norm_num h1:¬Nat.Prime 10001h2:Nat.Prime 6577h3:Nat.Prime 4177⊢ a 5 = 3 h1:¬Nat.Prime 10001h2:Nat.Prime 6577h3:Nat.Prime 4177⊢ a 5 = 3
have h4 : Nat.Prime 2657 := by norm_num h1:¬Nat.Prime 10001h2:Nat.Prime 6577h3:Nat.Prime 4177h4:Nat.Prime 2657⊢ a 5 = 3 h1:¬Nat.Prime 10001h2:Nat.Prime 6577h3:Nat.Prime 4177h4:Nat.Prime 2657⊢ a 5 = 3
have h5 : ¬ Nat.Prime 1921 := by norm_num h1:¬Nat.Prime 10001h2:Nat.Prime 6577h3:Nat.Prime 4177h4:Nat.Prime 2657h5:¬Nat.Prime 1921⊢ a 5 = 3 h1:¬Nat.Prime 10001h2:Nat.Prime 6577h3:Nat.Prime 4177h4:Nat.Prime 2657h5:¬Nat.Prime 1921⊢ a 5 = 3
have hIcc : Finset.Icc 1 5 = ({1, 2, 3, 4, 5} : Finset ℕ) := by decide 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}⊢ a 5 = 3 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}⊢ a 5 = 3
rw [a, 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}⊢ (∑ x ∈ Finset.Icc 1 5, if Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 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}⊢ (∑ x ∈ {1, 2, 3, 4, 5}, if Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 hIcc 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}⊢ (∑ x ∈ {1, 2, 3, 4, 5}, if Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 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}⊢ (∑ x ∈ {1, 2, 3, 4, 5}, if Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3] 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}⊢ (∑ x ∈ {1, 2, 3, 4, 5}, if Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3
have hcongr :
(∑ x ∈ ({1, 2, 3, 4, 5} : Finset ℕ),
if Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) =
∑ x ∈ ({1, 2, 3, 4, 5} : Finset ℕ), if x = 2 ∨ x = 3 ∨ x = 4 then 1 else 0 := by ⊢ a 5 = 3 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3
refine Finset.sum_congr rfl fun x hx => ?_ 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}x:ℕhx:x ∈ {1, 2, 3, 4, 5}⊢ (if Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = if x = 2 ∨ x = 3 ∨ x = 4 then 1 else 0 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3
fin_cases hx «0» 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}⊢ (if Nat.Prime (1 ^ 4 + (2 * 5 + 1 - 1) ^ 4) then 1 else 0) = if 1 = 2 ∨ 1 = 3 ∨ 1 = 4 then 1 else 0«1» 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}⊢ (if Nat.Prime (2 ^ 4 + (2 * 5 + 1 - 2) ^ 4) then 1 else 0) = if 2 = 2 ∨ 2 = 3 ∨ 2 = 4 then 1 else 0«2» 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}⊢ (if Nat.Prime (3 ^ 4 + (2 * 5 + 1 - 3) ^ 4) then 1 else 0) = if 3 = 2 ∨ 3 = 3 ∨ 3 = 4 then 1 else 0«3» 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}⊢ (if Nat.Prime (4 ^ 4 + (2 * 5 + 1 - 4) ^ 4) then 1 else 0) = if 4 = 2 ∨ 4 = 3 ∨ 4 = 4 then 1 else 0«4» 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}⊢ (if Nat.Prime (5 ^ 4 + (2 * 5 + 1 - 5) ^ 4) then 1 else 0) = if 5 = 2 ∨ 5 = 3 ∨ 5 = 4 then 1 else 0 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 <;> «0» 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}⊢ (if Nat.Prime (1 ^ 4 + (2 * 5 + 1 - 1) ^ 4) then 1 else 0) = if 1 = 2 ∨ 1 = 3 ∨ 1 = 4 then 1 else 0«1» 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}⊢ (if Nat.Prime (2 ^ 4 + (2 * 5 + 1 - 2) ^ 4) then 1 else 0) = if 2 = 2 ∨ 2 = 3 ∨ 2 = 4 then 1 else 0«2» 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}⊢ (if Nat.Prime (3 ^ 4 + (2 * 5 + 1 - 3) ^ 4) then 1 else 0) = if 3 = 2 ∨ 3 = 3 ∨ 3 = 4 then 1 else 0«3» 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}⊢ (if Nat.Prime (4 ^ 4 + (2 * 5 + 1 - 4) ^ 4) then 1 else 0) = if 4 = 2 ∨ 4 = 3 ∨ 4 = 4 then 1 else 0«4» 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}⊢ (if Nat.Prime (5 ^ 4 + (2 * 5 + 1 - 5) ^ 4) then 1 else 0) = if 5 = 2 ∨ 5 = 3 ∨ 5 = 4 then 1 else 0 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 simp «4» 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}⊢ ¬Nat.Prime 1921 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 <;> «0» 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}⊢ ¬Nat.Prime 10001«1» 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}⊢ Nat.Prime 6577«2» 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}⊢ Nat.Prime 4177«3» 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}⊢ Nat.Prime 2657«4» 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}⊢ ¬Nat.Prime 1921 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 first | exact h1 «4» 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}⊢ ¬Nat.Prime 1921 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 | exact h2 «4» 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}⊢ ¬Nat.Prime 1921 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 | exact h3 «4» 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}⊢ ¬Nat.Prime 1921 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 | exact h4 «4» 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}⊢ ¬Nat.Prime 1921 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 | exact h5 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3 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 Nat.Prime (x ^ 4 + (2 * 5 + 1 - x) ^ 4) then 1 else 0) = 3
rw [hcongr 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 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] 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
decide 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 := by n:ℕhn:1 ≤ n⊢ 0 < a n
sorry 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) := by n:ℕhn:1 ≤ n⊢ ∃ x, 1 ≤ x ∧ x ≤ n ∧ Nat.Prime (x ^ 2 + (2 * n + 1 - x) ^ 2)
sorry 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) := by 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)
sorry 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) := by n:ℕhn:1 ≤ nh_exc:n ∉ {2, 4}⊢ ∃ x, 1 ≤ x ∧ x ≤ n ∧ Nat.Prime (x ^ 16 + (2 * n + 1 - x) ^ 16)
sorry All goals completed! 🐙end OeisA218656