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

Difference between first odd semiprime $> 2^n$ and $2^n$

References:

namespace OeisA114137open Nat

The primary defining sequence a. $a(n)$ is the difference between first odd semiprime > $2^n$ and $2^n$. $$a(n) = \min {s \mid s > 2^n \text{ and } s \text{ is an odd semiprime}} - 2^n$$

noncomputable def a (n : ) : := let m := 2^n let s : Set := { s | s > m s.IsSemiprime Odd s } sInf s - mAll goals completed! 🐙@[category test, AMS 11] theorem a_1 : a 1 = 7 := a 1 = 7 apply a_eq_of 1 9 (IsSemiprime 9 Odd 9 All goals completed! 🐙) (2 ^ 1 < 9 All goals completed! 🐙) x:h1:2 ^ 1 < xh2:x < 9¬(x.IsSemiprime Odd x) x:h1:2 ^ 1 < 3h2:3 < 9¬(IsSemiprime 3 Odd 3)x:h1:2 ^ 1 < 4h2:4 < 9¬(IsSemiprime 4 Odd 4)x:h1:2 ^ 1 < 5h2:5 < 9¬(IsSemiprime 5 Odd 5)x:h1:2 ^ 1 < 6h2:6 < 9¬(IsSemiprime 6 Odd 6)x:h1:2 ^ 1 < 7h2:7 < 9¬(IsSemiprime 7 Odd 7)x:h1:2 ^ 1 < 8h2:8 < 9¬(IsSemiprime 8 Odd 8) x:h1:2 ^ 1 < 3h2:3 < 9¬(IsSemiprime 3 Odd 3)x:h1:2 ^ 1 < 4h2:4 < 9¬(IsSemiprime 4 Odd 4)x:h1:2 ^ 1 < 5h2:5 < 9¬(IsSemiprime 5 Odd 5)x:h1:2 ^ 1 < 6h2:6 < 9¬(IsSemiprime 6 Odd 6)x:h1:2 ^ 1 < 7h2:7 < 9¬(IsSemiprime 7 Odd 7)x:h1:2 ^ 1 < 8h2:8 < 9¬(IsSemiprime 8 Odd 8) All goals completed! 🐙@[category test, AMS 11] theorem a_2 : a 2 = 5 := a 2 = 5 apply a_eq_of 2 9 (IsSemiprime 9 Odd 9 All goals completed! 🐙) (2 ^ 2 < 9 All goals completed! 🐙) x:h1:2 ^ 2 < xh2:x < 9¬(x.IsSemiprime Odd x) x:h1:2 ^ 2 < 5h2:5 < 9¬(IsSemiprime 5 Odd 5)x:h1:2 ^ 2 < 6h2:6 < 9¬(IsSemiprime 6 Odd 6)x:h1:2 ^ 2 < 7h2:7 < 9¬(IsSemiprime 7 Odd 7)x:h1:2 ^ 2 < 8h2:8 < 9¬(IsSemiprime 8 Odd 8) x:h1:2 ^ 2 < 5h2:5 < 9¬(IsSemiprime 5 Odd 5)x:h1:2 ^ 2 < 6h2:6 < 9¬(IsSemiprime 6 Odd 6)x:h1:2 ^ 2 < 7h2:7 < 9¬(IsSemiprime 7 Odd 7)x:h1:2 ^ 2 < 8h2:8 < 9¬(IsSemiprime 8 Odd 8) All goals completed! 🐙@[category test, AMS 11] theorem a_3 : a 3 = 1 := a 3 = 1 apply a_eq_of 3 9 (IsSemiprime 9 Odd 9 All goals completed! 🐙) (2 ^ 3 < 9 All goals completed! 🐙) x:h1:2 ^ 3 < xh2:x < 9¬(x.IsSemiprime Odd x) All goals completed! 🐙@[category test, AMS 11] theorem a_4 : a 4 = 5 := a 4 = 5 apply a_eq_of 4 21 (IsSemiprime 21 Odd 21 All goals completed! 🐙) (2 ^ 4 < 21 All goals completed! 🐙) x:h1:2 ^ 4 < xh2:x < 21¬(x.IsSemiprime Odd x) x:h1:2 ^ 4 < 17h2:17 < 21¬(IsSemiprime 17 Odd 17)x:h1:2 ^ 4 < 18h2:18 < 21¬(IsSemiprime 18 Odd 18)x:h1:2 ^ 4 < 19h2:19 < 21¬(IsSemiprime 19 Odd 19)x:h1:2 ^ 4 < 20h2:20 < 21¬(IsSemiprime 20 Odd 20) x:h1:2 ^ 4 < 17h2:17 < 21¬(IsSemiprime 17 Odd 17)x:h1:2 ^ 4 < 18h2:18 < 21¬(IsSemiprime 18 Odd 18)x:h1:2 ^ 4 < 19h2:19 < 21¬(IsSemiprime 19 Odd 19)x:h1:2 ^ 4 < 20h2:20 < 21¬(IsSemiprime 20 Odd 20) All goals completed! 🐙@[category test, AMS 11] theorem a_5 : a 5 = 1 := a 5 = 1 apply a_eq_of 5 33 (IsSemiprime 33 Odd 33 All goals completed! 🐙) (2 ^ 5 < 33 All goals completed! 🐙) x:h1:2 ^ 5 < xh2:x < 33¬(x.IsSemiprime Odd x) All goals completed! 🐙

In this powers of 2 sequence, does 1 occur infinitely often?

@[category research open, AMS 11] theorem conjecture1 : answer(sorry) Set.Infinite {n : | a n = 1} := True {n | a n = 1}.Infinite All goals completed! 🐙

Does every odd number occur?

@[category research open, AMS 11] theorem conjecture2 : answer(sorry) k : , Odd k n : , a n = k := True (k : ), Odd k n, OeisA114137.a n = k All goals completed! 🐙end OeisA114137