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

Smallest $m$ such that $n^3 + m^3 + 1$ is prime

$a(n)$ is the smallest natural number $m \ge 1$ such that $n^3 + m^3 + 1$ is prime.

References:

namespace OeisA159829open Classical in

$a(n)$ is the smallest natural number $m \ge 1$ such that $n^3 + m^3 + 1$ is prime, or none if no such $m$ exists.

noncomputable def a (n : ) : Option := if m : , 1 m (n ^ 3 + m ^ 3 + 1).Prime then some (sInf {m : | 1 m (n ^ 3 + m ^ 3 + 1).Prime}) else none

Value of the sequence a at 1.

All goals completed! 🐙

Value of the sequence a at 2.

All goals completed! 🐙

Value of the sequence a at 3.

All goals completed! 🐙

Value of the sequence a at 4.

All goals completed! 🐙

Conjecture 1: For any $k \ge 3$, there are infinitely many primes of the form $n^k + m^k$ for $n, m \ge 1$.

    Ulrich Krug, 2009

Answer: No.

    Kenta Kitamura, 2026

@[category research solved, AMS 11, formal_proof using lean4 at "https://github.com/KitaKen1/oeis-a159829-conjecture1-counterexample/blob/6632e626baa7f28ad14045aa7408a84178ec128d/lean/A159829Conjecture1FC.lean#L52-L61"] theorem conjecture1 : answer(False) (k : ), 3 k Set.Infinite {p : | n m : , 1 n 1 m p.Prime p = n ^ k + m ^ k} := False (k : ), 3 k {p | n m, 1 n 1 m Nat.Prime p p = n ^ k + m ^ k}.Infinite All goals completed! 🐙

Conjecture 2: For any $k \ge 3$, there are infinitely many primes of the form $n^k + m^k + 1$ for $n, m \ge 1$.

    Ulrich Krug, 2009

@[category research open, AMS 11] theorem conjecture2 (k : ) (hk : 3 k) : Set.Infinite {p : | n m : , 1 n 1 m p.Prime p = n ^ k + m ^ k + 1} := k:hk:3 k{p | n m, 1 n 1 m Nat.Prime p p = n ^ k + m ^ k + 1}.Infinite All goals completed! 🐙end OeisA159829