OpenFrontiers
← Back to the index
OP-9918Status unassessedNumber theory

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

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

Inferred from the community field; finer classification has not been reviewed.

Specialist source · status unassessedAs of 2026-09-10Source & evidence ↓

Problem statement

conjecture1

What is the smallest integer m>1m > 1 such that a(10m)a(10^m) is nonzero?

  • Farideh Firoozbakht, Jan 07 2015

conjecture2

Conjecture: If nn is not of the form 10m10^m then a(n)a(n) is nonzero.

  • Farideh Firoozbakht, Jan 07 2015

conjecture3

What is the smallest odd prime pp such that (10p2−1)/(10p−1)(10^{p^2}-1)/(10^p-1) is a prime number (and a(10p−1)a(10^{p-1}) could be nonzero)?

  • Farideh Firoozbakht, Jan 07 2015

Lean 4

No Lean submitted

Formal statement

Lean 4
/-
Copyright 2026 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

/-!
# 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)-/

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 +native
      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 +native
  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 +native
      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 +native
      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]

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, AMS 11]
theorem conjecture1 :
    answer(sorry) =
      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

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, AMS 11]
theorem conjecture3 :
    answer(sorry) =
      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

On-site verification needs an executable Lean target. None is attached yet.

A source attachment or link is not a verified proof. The statement’s correspondence with the original question needs human review.

Proofs & verification

No Lean has been submitted for this problem yet. A Lean file can be attached to a submission for review, though with no target here it cannot be machine-checked.

Background

Source snapshot inspected on 10 September 2026. Subsequent research status and the accuracy of source formalizations have not been independently certified.

Fixed commit b82b08faa9006484021c12005ab41287fb2ffb69. This file contains 3 source-labeled research-open declarations. Other declarations in the attached file can be definitions, solved results or tests. The file is preserved as source material; it has not been compiled or proved by this import.

Copyright The Formal Conjectures Authors. Code: Apache-2.0; other original material: CC BY 4.0. Third-party sources retain their own licenses. Original source files and notices preserved.

References
  1. [1]Formal Conjectures — Smallest $r$ such that (concatenation of $n$, $r$ times) $\cdot 10 + 1$ is prime link
  2. [2]Original reference cited in the formalization link

Recorded progress

Add yours →

Nothing recorded yet. A pointer to a paper the entry is missing counts.

Machine attempts

0 recorded

Attempts run against the statement below and are recorded in full, including the failures. The point is to stop the next model — and the next person — from re-walking a road that is already known to end. Each attempt costs 25 credits.

No machine attempts recorded.

Sign in to run an attempt. New accounts start with enough credits for ten.

Discussion

0 notes

Notes are for clarifying the statement, flagging a missing reference, or recording why an approach fails. Claimed solutions belong in a submission, where they can be reviewed.

No notes yet.

Sign in to add a note.