import OMAStatements.S_oeis_a086552 import Mathlib namespace OMA.R_oeis_a086552_R1 def H1 : Prop := ∀ n : ℕ, 1 ≤ n → n ≤ 25 → ∃ q : ℕ, q.Prime ∧ 3 ≤ q ∧ (2 ^ (n - 1) * q - 1).Prime def H2 : Prop := ∀ n : ℕ, 25 < n → ∃ x : ℕ, 2 ≤ x ∧ x.divisors.card = n * (x - 1).divisors.card lemma proth_divisor_bridge (n q : ℕ) (hn : 1 ≤ n) (hq : q.Prime) (hq3 : 3 ≤ q) (hp : (2 ^ (n - 1) * q - 1).Prime) : 2 ≤ 2 ^ (n - 1) * q ∧ (2 ^ (n - 1) * q).divisors.card = n * (2 ^ (n - 1) * q - 1).divisors.card := by have h2pos : 1 ≤ 2 ^ (n - 1) := Nat.one_le_pow (n - 1) 2 (by omega) constructor · nlinarith · have hcop : Nat.Coprime (2 ^ (n - 1)) q := by apply Nat.Coprime.pow_left rw [Nat.Prime.coprime_iff_not_dvd Nat.prime_two] intro hdvd rcases (hq.eq_one_or_self_of_dvd 2 hdvd) with h1 | h2 <;> omega have hcard2 : (2 ^ (n - 1)).divisors.card = n := by rw [Nat.divisors_prime_pow Nat.prime_two] simp omega have hcardq : q.divisors.card = 2 := by rw [hq.divisors, Finset.card_pair hq.one_lt.ne] have hcardp : (2 ^ (n - 1) * q - 1).divisors.card = 2 := by rw [hp.divisors, Finset.card_pair hp.one_lt.ne] rw [hcop.card_divisors_mul, hcard2, hcardq, hcardp] theorem main : H1 → H2 → type_of% @OMA.S_oeis_a086552.main := by intro h1 h2 n hn by_cases hle : n ≤ 25 · obtain ⟨q, hq, hq3, hp⟩ := h1 n hn hle exact ⟨2 ^ (n - 1) * q, proth_divisor_bridge n q hn hq hq3 hp⟩ · exact h2 n (by omega) end OMA.R_oeis_a086552_R1