/-
Copyright 2025 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 FormalConjecturesUtilNumbers $n$ such that $n^2 + \pi(n)$ is prime.
namespace OeisA228828
open scoped Nat.Prime
Numbers n such that $n^2 + \pi(n)$ is prime.
noncomputable def a (n : ℕ) : ℕ := n.nth (fun n => (n ^ 2 + π n).Prime)
@[category test, AMS 11]
theorem a_0 : a 0 = 2 := ⊢ a 0 = 2
⊢ Nat.nth (fun n => Nat.Prime (n ^ 2 + π n)) 0 = 2
⊢ 0 = Nat.count (fun n => Nat.Prime (n ^ 2 + π n)) 2⊢ DecidablePred fun n => Nat.Prime (n ^ 2 + π n)⊢ Nat.Prime (2 ^ 2 + π 2)
⊢ 0 = Nat.count (fun n => Nat.Prime (n ^ 2 + π n)) 2 All goals completed! 🐙
⊢ DecidablePred fun n => Nat.Prime (n ^ 2 + π n) All goals completed! 🐙
⊢ Nat.Prime (2 ^ 2 + π 2) All goals completed! 🐙
@[category test, AMS 11]
theorem a_1 : a 1 = 3 := ⊢ a 1 = 3
⊢ Nat.nth (fun n => Nat.Prime (n ^ 2 + π n)) 1 = 3
⊢ 1 = Nat.count (fun n => Nat.Prime (n ^ 2 + π n)) 3⊢ DecidablePred fun n => Nat.Prime (n ^ 2 + π n)⊢ Nat.Prime (3 ^ 2 + π 3)
⊢ 1 = Nat.count (fun n => Nat.Prime (n ^ 2 + π n)) 3 ⊢ Nat.Prime (4 + π 2)
All goals completed! 🐙
⊢ DecidablePred fun n => Nat.Prime (n ^ 2 + π n) All goals completed! 🐙
⊢ Nat.Prime (3 ^ 2 + π 3) All goals completed! 🐙
@[category test, AMS 11]
theorem a_2 : a 2 = 7 := ⊢ a 2 = 7
⊢ Nat.nth (fun n => Nat.Prime (n ^ 2 + π n)) 2 = 7
⊢ 2 = Nat.count (fun n => Nat.Prime (n ^ 2 + π n)) 7⊢ DecidablePred fun n => Nat.Prime (n ^ 2 + π n)⊢ Nat.Prime (7 ^ 2 + π 7)
⊢ 2 = Nat.count (fun n => Nat.Prime (n ^ 2 + π n)) 7 ⊢ 2 =
((((if Nat.Prime (4 + π 2) then 1 else 0) + if Nat.Prime (9 + π 3) then 1 else 0) +
if Nat.Prime (16 + π 4) then 1 else 0) +
if Nat.Prime (25 + π 5) then 1 else 0) +
if Nat.Prime (36 + π 6) then 1 else 0
All goals completed! 🐙
⊢ DecidablePred fun n => Nat.Prime (n ^ 2 + π n) All goals completed! 🐙
⊢ Nat.Prime (7 ^ 2 + π 7) All goals completed! 🐙
Conjecture: the sequence A228828 is infinite.
@[category research open, AMS 11]
theorem a.infinite : {a n | n}.Infinite := ⊢ {x | ∃ n, a n = x}.Infinite
All goals completed! 🐙
end OeisA228828