/- 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 > 0$ such that $n \cdot 2^m + 1$ is prime

The sequence $a(n)$ is the smallest positive integer $m$ such that $n \cdot 2^m + 1$ is prime, or $0$ if no such $m$ exists.

References:

namespace OeisA78680open Classical in

Smallest $m > 0$ such that $n \cdot 2^m + 1$ is prime, or 0 if no such $m$ exists.

noncomputable def a (n : ) : := if h : m, 0 < m (n * 2 ^ m + 1).Prime then Nat.find h else 0

Value of the sequence a at 1.

h: m, 0 < m Nat.Prime (1 * 2 ^ m + 1)(0 < 1 Nat.Prime (1 * 2 ^ 1 + 1)) n < 1, ¬(0 < n Nat.Prime (1 * 2 ^ n + 1)) All goals completed! 🐙 h:¬ m, 0 < m Nat.Prime (1 * 2 ^ m + 1)False exact (h 1, h:¬ m, 0 < m Nat.Prime (1 * 2 ^ m + 1)0 < 1 Nat.Prime (1 * 2 ^ 1 + 1) All goals completed! 🐙).elim

Value of the sequence a at 2.

h: m, 0 < m Nat.Prime (2 * 2 ^ m + 1)(0 < 1 Nat.Prime (2 * 2 ^ 1 + 1)) n < 1, ¬(0 < n Nat.Prime (2 * 2 ^ n + 1)) All goals completed! 🐙 h:¬ m, 0 < m Nat.Prime (2 * 2 ^ m + 1)False exact (h 1, h:¬ m, 0 < m Nat.Prime (2 * 2 ^ m + 1)0 < 1 Nat.Prime (2 * 2 ^ 1 + 1) All goals completed! 🐙).elim

Value of the sequence a at 3.

h: m, 0 < m Nat.Prime (3 * 2 ^ m + 1)(0 < 1 Nat.Prime (3 * 2 ^ 1 + 1)) n < 1, ¬(0 < n Nat.Prime (3 * 2 ^ n + 1)) All goals completed! 🐙 h:¬ m, 0 < m Nat.Prime (3 * 2 ^ m + 1)False exact (h 1, h:¬ m, 0 < m Nat.Prime (3 * 2 ^ m + 1)0 < 1 Nat.Prime (3 * 2 ^ 1 + 1) All goals completed! 🐙).elim

Value of the sequence a at 4.

h: m, 0 < m Nat.Prime (4 * 2 ^ m + 1)(0 < 2 Nat.Prime (4 * 2 ^ 2 + 1)) n < 2, ¬(0 < n Nat.Prime (4 * 2 ^ n + 1)) All goals completed! 🐙 h:¬ m, 0 < m Nat.Prime (4 * 2 ^ m + 1)False exact (h 2, h:¬ m, 0 < m Nat.Prime (4 * 2 ^ m + 1)0 < 2 Nat.Prime (4 * 2 ^ 2 + 1) All goals completed! 🐙).elim

Value of the sequence a at 5.

h: m, 0 < m Nat.Prime (5 * 2 ^ m + 1)(0 < 1 Nat.Prime (5 * 2 ^ 1 + 1)) n < 1, ¬(0 < n Nat.Prime (5 * 2 ^ n + 1)) All goals completed! 🐙 h:¬ m, 0 < m Nat.Prime (5 * 2 ^ m + 1)False exact (h 1, h:¬ m, 0 < m Nat.Prime (5 * 2 ^ m + 1)0 < 1 Nat.Prime (5 * 2 ^ 1 + 1) All goals completed! 🐙).elim

There is a conjecture that the first zero is $n = 65536 = 2^{16}$ (which is equivalent to the statement that $2^{2^k} + 1$ is composite for $k > 4$). - T. D. Noe, Feb 25 2011

@[category research open, AMS 11] theorem conjecture : a (2 ^ 16) = 0 n : , 1 n n < 2 ^ 16 a n 0 := a (2 ^ 16) = 0 (n : ), 1 n n < 2 ^ 16 OeisA78680.a n 0 All goals completed! 🐙end OeisA78680