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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Smallest rr such that (concatenation of nn, rr times) ⋅10+1\cdot 10 + 1 is prime · a_1

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

Value of the sequence a at 1.

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

Formal statement

theorem a_1 : a 1 = 1
Show the full Challenge.lean (185 lines) — definitions included
module

public import FormalConjecturesUtil


/-!
# Smallest $r$ such that (concatenation of $n$, $r$ times) $\cdot 10 + 1$ is prime

$a(n)$ is the smallest $r$ where (concatenation of $n$, $r$ times with itself) $\cdot 10 + 1$
is a prime, or $0$ if no such number exists.
The number resulting from concatenating $n$, $r$ times, is
$n \cdot \sum_{i=0}^{r-1} (10^d)^i$, where $d$ is the number of digits of $n$.

*References:*
- [A086766](https://oeis.org/A086766)-/

@[expose] public section

namespace OeisA86766

/-- Sequence $a(n)$ is the smallest $r > 0$ such that the concatenation of $n$, $r$ times
with itself, multiplied by $10$ plus $1$, is prime, or $0$ if no such prime exists. -/
noncomputable def a (n : ℕ) : ℕ :=
  if n = 0 then 0
  else
    let ℓ : ℕ := (Nat.digits 10 n).length
    let M : ℕ := 10 ^ ℓ
    let repCatVal (r : ℕ) : ℕ := n * ∑ i ∈ Finset.range r, M ^ i
    let primeCandidate (r : ℕ) : ℕ := repCatVal r * 10 + 1
    sInf {r : ℕ | 0 < r ∧ (primeCandidate r).Prime}

/-- Value of the sequence `a` at 0. -/
@[category test, AMS 11]
theorem a_0 : a 0 = 0 := by rfl

/-- Value of the sequence `a` at 1. -/
@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by
  have h_least : IsLeast {r : ℕ | 0 < r ∧ ((1 * ∑ i ∈ Finset.range r, (10 ^ (Nat.digits 10
  1).length) ^ i) * 10 + 1).Prime} 1 := by
    constructor
    · simp only [Set.mem_ofPred_eq]
      refine ⟨by omega, ?_⟩
      have : (Nat.digits 10 1).length = 1 := by decide
      rw [this]
      norm_num
    · intro r hr
      simp only [Set.mem_ofPred_eq] at hr
      exact hr.1
  have ha1 : a 1 = sInf {r : ℕ | 0 < r ∧ ((1 * ∑ i ∈ Finset.range r, (10 ^ (Nat.digits 10
  1).length) ^ i) * 10 + 1).Prime} := by
    unfold a
    split <;> [omega; rfl]
  rw [ha1, h_least.csInf_eq]

/-- Value of the sequence `a` at 2. -/
@[category test, AMS 11]
theorem a_2 : a 2 = 3 := by
  have h_digits : (Nat.digits 10 2).length = 1 := by decide
  have h_least : IsLeast {r : ℕ | 0 < r ∧ ((2 * ∑ i ∈ Finset.range r, (10 ^ (Nat.digits 10
  2).length) ^ i) * 10 + 1).Prime} 3 := by
    constructor
    · simp only [Set.mem_ofPred_eq]
      refine ⟨by omega, ?_⟩
      rw [h_digits]
      norm_num
    · intro r hr
      simp only [Set.mem_ofPred_eq] at hr
      by_contra! h
      have hr_pos := hr.1
      interval_cases r
      · have hr2 := hr.2
        rw [h_digits] at hr2
        revert hr2
        norm_num
      · have hr2 := hr.2
        rw [h_digits] at hr2
        revert hr2
        norm_num
  have ha2 : a 2 = sInf {r : ℕ | 0 < r ∧ ((2 * ∑ i ∈ Finset.range r, (10 ^ (Nat.digits 10
  2).length) ^ i) * 10 + 1).Prime} := by
    unfold a
    split <;> [omega; rfl]
  rw [ha2, h_least.csInf_eq]

/-- Value of the sequence `a` at 3. -/
@[category test, AMS 11]
theorem a_3 : a 3 = 1 := by
  have h_least : IsLeast {r : ℕ | 0 < r ∧ ((3 * ∑ i ∈ Finset.range r, (10 ^ (Nat.digits 10
  3).length) ^ i) * 10 + 1).Prime} 1 := by
    constructor
    · simp only [Set.mem_ofPred_eq]
      refine ⟨by omega, ?_⟩
      have : (Nat.digits 10 3).length = 1 := by decide
      rw [this]
      norm_num
    · intro r hr
      simp only [Set.mem_ofPred_eq] at hr
      exact hr.1
  have ha3 : a 3 = sInf {r : ℕ | 0 < r ∧ ((3 * ∑ i ∈ Finset.range r, (10 ^ (Nat.digits 10
  3).length) ^ i) * 10 + 1).Prime} := by
    unfold a
    split <;> [omega; rfl]
  rw [ha3, h_least.csInf_eq]

/-- Value of the sequence `a` at 4. -/
@[category test, AMS 11]
theorem a_4 : a 4 = 1 := by
  have h_least : IsLeast {r : ℕ | 0 < r ∧ ((4 * ∑ i ∈ Finset.range r, (10 ^ (Nat.digits 10
  4).length) ^ i) * 10 + 1).Prime} 1 := by
    constructor
    · simp only [Set.mem_ofPred_eq]
      refine ⟨by omega, ?_⟩
      have : (Nat.digits 10 4).length = 1 := by decide
      rw [this]
      norm_num
    · intro r hr
      simp only [Set.mem_ofPred_eq] at hr
      exact hr.1
  have ha4 : a 4 = sInf {r : ℕ | 0 < r ∧ ((4 * ∑ i ∈ Finset.range r, (10 ^ (Nat.digits 10
  4).length) ^ i) * 10 + 1).Prime} := by
    unfold a
    split <;> [omega; rfl]
  rw [ha4, h_least.csInf_eq]

def conjecture1.answer : Option ℕ := sorry

open scoped Classical in
/--
What is the smallest integer $m > 1$ such that $a(10^m)$ is nonzero?
- _Farideh Firoozbakht_, Jan 07 2015
-/
@[category research open, question value, AMS 11]
theorem conjecture1 :
    conjecture1.answer =
      if h : ∃ m, 1 < m ∧ a (10 ^ m) ≠ 0 then
        some (sInf {m | 1 < m ∧ a (10 ^ m) ≠ 0})
      else
        none := by
  sorry


/--
Conjecture: If $n$ is not of the form $10^m$ then $a(n)$ is nonzero.
- _Farideh Firoozbakht_, Jan 07 2015
-/
@[category research open, AMS 11]
theorem conjecture2 (n : ℕ) (hn : 0 < n) (h : ∀ m : ℕ, n ≠ 10 ^ m) : a n ≠ 0 := by
  sorry

def conjecture3.answer : Option ℕ := sorry

open scoped Classical in
/--
What is the smallest odd prime $p$ such that $(10^{p^2}-1)/(10^p-1)$ is a prime number
(and $a(10^{p-1})$ could be nonzero)?
- _Farideh Firoozbakht_, Jan 07 2015
-/
@[category research open, question value, AMS 11]
theorem conjecture3 :
    conjecture3.answer =
      if h : ∃ p, p.Prime ∧ 2 < p ∧ ((10 ^ (p ^ 2) - 1) / (10 ^ p - 1)).Prime then
        some (sInf {p | p.Prime ∧ 2 < p ∧ ((10 ^ (p ^ 2) - 1) / (10 ^ p - 1)).Prime})
      else
        none := by
  sorry

end OeisA86766

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

nosorry desk oeis-86766--a-1      # a desk lease: required before submitting (renew: nosorry beat)
nosorry fetch oeis-86766--a-1
nosorry submit oeis-86766--a-1 nosorry/oeis-86766--a-1/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.