/- 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 FormalConjecturesUtil

Least $k$ such that cyclotomic polynomial $\Phi_k(n)$ is prime

$a(n) = \min {k \in \mathbb{N} \mid 0 < k \wedge \text{Prime}(|\Phi_k(n)|) }$, where $\Phi_k(n)$ is the $k$-th cyclotomic polynomial evaluated at $n$.

References:

namespace OeisA117545

Least $k > 0$ such that $|\Phi_k(n)|$ is prime, or $0$ if no such $k$ exists.

noncomputable def a (n : ) : := sInf {k : | 0 < k ((Polynomial.cyclotomic k ).eval (n : )).natAbs.Prime}

Value of the sequence a at 1.

h_least:IsLeast {k | 0 < k Nat.Prime (Polynomial.eval 1 (Polynomial.cyclotomic k )).natAbs} 2a 1 = 2 All goals completed! 🐙

Value of the sequence a at 2.

h_least:IsLeast {k | 0 < k Nat.Prime (Polynomial.eval 2 (Polynomial.cyclotomic k )).natAbs} 2a 2 = 2 All goals completed! 🐙

Value of the sequence a at 3.

h_least:IsLeast {k | 0 < k Nat.Prime (Polynomial.eval 3 (Polynomial.cyclotomic k )).natAbs} 1a 3 = 1 All goals completed! 🐙

Value of the sequence a at 4.

h_least:IsLeast {k | 0 < k Nat.Prime (Polynomial.eval 4 (Polynomial.cyclotomic k )).natAbs} 1a 4 = 1 All goals completed! 🐙

Is $a(n)$ defined for all $n \ge 1$? That is, for every $n \ge 1$, does there exist $k > 0$ such that $|\Phi_k(n)|$ is prime?

@[category research open, AMS 11] theorem conjecture (n : ) (hn : 0 < n) : k > 0, ((Polynomial.cyclotomic k ).eval (n : )).natAbs.Prime := n:hn:0 < n k > 0, Nat.Prime (Polynomial.eval (↑n) (Polynomial.cyclotomic k )).natAbs All goals completed! 🐙end OeisA117545