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

Erdős Problem 9

Reference: erdosproblems.com/9

namespace Erdos9

The set of odd numbers that cannot be expressed as a prime plus two powers of 2.

def Erdos9A : Set := { n | Odd n ¬ (p k l : ), (Nat.Prime p) n = p + 2 ^ k + 2 ^ l } @[category test, AMS 5 11] theorem erdos9A_contains_one : 1 Erdos9A := 1 Erdos9A Odd 1¬ p k l, Nat.Prime p 1 = p + 2 ^ k + 2 ^ l Odd 1 All goals completed! 🐙 ¬ p k l, Nat.Prime p 1 = p + 2 ^ k + 2 ^ l (p k l : ), Nat.Prime p 1 p + 2 ^ k + 2 ^ l intro p p:k: (l : ), Nat.Prime p 1 p + 2 ^ k + 2 ^ l p:k:l:Nat.Prime p 1 p + 2 ^ k + 2 ^ l p:k:l:hp:Nat.Prime p1 p + 2 ^ k + 2 ^ l All goals completed! 🐙 @[category test, AMS 5 11] theorem erdos9A_contains_three : 3 Erdos9A := 3 Erdos9A Odd 3¬ p k l, Nat.Prime p 3 = p + 2 ^ k + 2 ^ l Odd 3 All goals completed! 🐙 ¬ p k l, Nat.Prime p 3 = p + 2 ^ k + 2 ^ l (p k l : ), Nat.Prime p 3 p + 2 ^ k + 2 ^ l intro p p:k: (l : ), Nat.Prime p 3 p + 2 ^ k + 2 ^ l p:k:l:Nat.Prime p 3 p + 2 ^ k + 2 ^ l p:k:l:hp:Nat.Prime p3 p + 2 ^ k + 2 ^ l All goals completed! 🐙 @[category test, AMS 5 11] theorem erdos9A_not_contains_five : 5 Erdos9A := 5 Erdos9A 5 {n | Odd n ¬ p k l, Nat.Prime p n = p + 2 ^ k + 2 ^ l} Odd 5 x, (_ : Nat.Prime x), x_1 x_2, 5 = x + 2 ^ x_1 + 2 ^ x_2 a✝:Odd 5 x, (_ : Nat.Prime x), x_1 x_2, 5 = x + 2 ^ x_1 + 2 ^ x_2 a✝:Odd 55 = 3 + 2 ^ 0 + 2 ^ 0 All goals completed! 🐙

The set is known to be infinite. In [Er77c] Erdős credits Schinzel with proving that there are infinitely many odd integers not of this form, but gives no reference.

[Er77c] Erdős, P., Problems and results on combinatorial number theory. III..

@[category research solved, AMS 5 11] theorem declaration uses 'sorry'erdos_9.variants.infinite : Erdos9A.Infinite := Erdos9A.Infinite All goals completed! 🐙

Is the upper density of the set of odd numbers that cannot be expressed as a prime plus two powers of 2 positive?

@[category research open, AMS 5 11] theorem declaration uses 'sorry'erdos_9 : answer(sorry) 0 < Erdos9A.upperDensity := True 0 < Erdos9A.upperDensity All goals completed! 🐙 end Erdos9