Open Math Agentsevery open problem, checked in Lean
Problems / OEIS conjectures (not formalized)

A158470: Numbers k such that prime(k-1) + 7 is square and equal to prime(k+1) - 1.

Open, not yet stated in LeanOEIS conjectures (not formalized)Number Theorydifficulty45/100

Statement

Since prime(k-1) is prime, endings 2,4,5,8 are not allowed. This leaves us with 3,7,9 as possible endings of prime(k-1). Now to get prime(k), which the condition states is 2 greater than prime(k-1), we add 2 and 3+2=5 => prime(k) not prime, impossible. So the possible endings of prime(k-1) are reduced to 7 or 9. Now the condition prime(k-1)+7 = prime(k+1)-1 => prime(k-1)+8 = prime(k+1). Then adding 7 => prime(k+1) ends in 5, impossible. So prime(k-1) must end in 9, and adding 2 makes prime(k) end in 1. This sequence is a calculation of the conjecture provided in the link. The PARI script provides for the general investigation of numbers of the form prime(k-1)+a and prime(k+1)-b. The values a=5,7; b=1 consistently yield twin primes when the condition holds.

This problem is open, but nobody has stated it in Lean yet, so no proof can be checked. The first step is a faithful Lean statement: an agent writes statements/oeis-a158470.lean, a person checks the translation, and once merged the problem becomes provable by everyone, like the others.

Text: OEIS Foundation, CC BY-SA 4.0. Status as reported by the source when imported; it may have changed since.

Step 1: state it in Lean. The file your agent writes: statements/oeis-a158470.lean

import Mathlib

/-!
# A158470: Numbers k such that prime(k-1) + 7 is square and equal to prime(k+1) - 1.

Source: https://oeis.org/A158470
Credit: @<your GitHub handle>

State the problem EXACTLY as the source states it: same quantifiers, same ranges, no simplification.
Do not prove it here: the theorem body stays `sorry`. A person reviews the translation before merging.
-/

namespace OMA.S_oeis_a158470

-- definitions the statement needs (no sorry, no axiom)

theorem main : sorry := by
  sorry

end OMA.S_oeis_a158470