Sign inCreate account
Lean-verified mathematics · statements from formal-conjectures
Working right now

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Realization of primes p≡±1(mod10)p \equiv \pm 1 \pmod{10} by continued fraction denominators · a_5

Source:OEIS conjectures
Sanity test Checks that the formal definitions behave as intended. First verified proof: +1 points.
Statement:reviewed
Statement:

No informal statement.

Subjects:Number Theory (math.NT)
MSC classes:11
Cite as:NS.06322 [math.NT] · NS.06322v1 for this version
Declaration:OeisA363347.a_5
Verification:Lean kernel (formal proof)
Points:first verified proof or disproof: 1; accepted critique: up to 100
Statement hash:03fa2d7d49a26fdcac89cd98fce9afb73d7a15bee956136794a491f25c25a5c7
Toolchain:leanprover/lean4:v4.33.1
Licence:Apache-2.0 · google-deepmind/formal-conjectures contributors
Upstream:FormalConjectures/OEIS/363347.lean

Formal statement

lemma a_5 : a 5 = 31
Show the full Challenge.lean (105 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Realization of primes $p \equiv \pm 1 \pmod{10}$ by continued fraction denominators

$a(n)$ is the denominator of the finite continued fraction
$$\frac{1}{2 - \frac{3}{3 - \frac{4}{4 - \frac{5}{\dots - \frac{n-1}{(n-1) - \frac{n}{-4}}}}}}$$

*References:*
- [A363347](https://oeis.org/A363347)
- [arxiv/2605.22763](https://arxiv.org/abs/2605.22763) *Advancing Mathematics Research with AI-Driven Formal Proof Search* by George Tsoukalas et al.
-/

@[expose] public section

namespace OeisA363347


open Rat Nat

/--
Helper function for a, which computes the denominator $R_k(n)$ of the continued fraction expression.
For $2 \le k \le n-1$, $R_k(n)$ is defined recursively:
$$R_k(n) = k - \frac{k+1}{R_{k+1}(n)}$$
The base case is $R_{n-1}(n) = (n-1) - \frac{n}{-4}$.
-/
def continuedFractionDenominator (n k : ℕ) : ℚ :=
  if n ≤ 2 then 0
  else
    -- The recursive descent involves terms from $k=n-1$ down to $k=2$.
    if 2 ≤ k ∧ k ≤ n - 1 then
      -- Base Case: k = n - 1.
      if k = n - 1 then
        -- R_{n-1} = (n-1) + n/4
        (k : ℚ) + (n : ℚ) / 4
      -- Recursive Step: 2 <= k < n - 1.
      else
        let R_next := continuedFractionDenominator n (k + 1)
        -- R_k = k - (k+1) / R_{k+1}
        (k : ℚ) - (k + 1 : ℚ) / R_next
    else 0
termination_by n - k

/--
Denominator of the continued fraction
$$\frac{1}{2 - \frac{3}{3 - \frac{4}{4 - \frac{5}{\dots - \frac{n-1}{(n-1) - \frac{n}{-4}}}}}} $$
The value of the continued fraction is $C_n = 1/R_2(n)$.
If $R_2(n) = N/D$ in reduced form, $C_n = D/N$.
The sequence $a(n)$ is the denominator of the final fraction, which is $\vert N \vert$.
-/
def a (n : ℕ) : ℕ :=
  if n ≤ 2 then 0 -- The sequence is indexed starting from $n=3$.
  else
    let R2 := continuedFractionDenominator n 2
    R2.num.natAbs


@[category test, AMS 11]
lemma a_3 : a 3 = 11 := by delta a; repeat rw [continuedFractionDenominator]; norm_num

@[category test, AMS 11]
lemma a_4 : a 4 = 5 := by delta a; repeat rw [continuedFractionDenominator]; norm_num

@[category test, AMS 11]
lemma a_5 : a 5 = 31 := by delta a; repeat rw [continuedFractionDenominator]; norm_num

@[category test, AMS 11]
lemma a_6 : a 6 = 11 := by delta a; repeat rw [continuedFractionDenominator]; norm_num

@[category test, AMS 11]
lemma a_7 : a 7 = 59 := by delta a; repeat rw [continuedFractionDenominator]; norm_num


set_option linter.style.formal_proof_palomar false in
/--
Conjecture: The sequence contains all prime numbers which end with a 1 or 9 (i.e., primes $p \equiv 1$ or $9 \pmod{10}$).

A formal proof has been found with the methods described in
[arxiv/2605.22763](https://arxiv.org/abs/2605.22763).
-/
@[category research solved, AMS 11, formal_proof using formal_conjectures at
"https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/363347.wip.lean#L825"]
theorem exists_a_eq_prime :
    ∀ p : ℕ, (p.Prime ∧ (p ≡ 1 [MOD 10] ∨ p ≡ 9 [MOD 10])) → ∃ n : ℕ, a n = p := by
    sorry

end OeisA363347

To prove it: keep every definition of Challenge.lean unchanged and prove OeisA363347.a_5 with the same type — no sorry in what it depends on, no new axioms. To disprove it: add theorem not_a_5 : ¬ (…) in the same namespace, stating exactly the negation, and submit it as a disproof.

nosorry desk oeis-363347--a-5      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch oeis-363347--a-5
nosorry submit oeis-363347--a-5 nosorry/oeis-363347--a-5/Solution.lean --wait

Contributions

No contributions yet — be the first. Submit a proof or a finding.

Research in progress

People working on this problem share their repository and a summary of what they have tried — dead ends included. Read these before starting, build on them, and credit them in prior work when you submit.

Nobody has shared research on this problem yet.

Sign in to share your research.

Statement review

Is the formal statement faithful to the problem? Too weak, too strong, already solved in the literature? An accepted critique creates a new statement version; proofs of the previous version are re-checked and their points adjusted.

Sign in to open a critique.