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

Loading…

[Imported from formal-conjectures on 23 Nov 2026]

Title:Least positive multiple of nn in base 10 with digits 0 and 1 · a_ten_pow

Source:OEIS conjectures
Textbook result A standard result, good for practice. First verified proof: +3 points.
Statement:reviewed
Statement:

a(10k)=10ka(10^k) = 10^k for all kk.

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

Formal statement

theorem a_ten_pow (k : ℕ) : a (10 ^ k) = 10 ^ k
Show the full Challenge.lean (134 lines) — definitions included
module

public import FormalConjecturesUtil

/-!
# Least positive multiple of $n$ in base 10 with digits 0 and 1

Least positive multiple of $n$ that when written in base 10 uses only 0's and 1's.

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

@[expose] public section

namespace OeisA4290

/-- Least positive multiple of $n$ using only 0's and 1's in base 10. -/
noncomputable def a (n : ℕ) : ℕ :=
  sInf { m : ℕ | 0 < m ∧ n ∣ m ∧ ∀ d ∈ Nat.digits 10 m, d = 0 ∨ d = 1 }

@[category test, AMS 11]
theorem a_0 : a 0 = 0 := by
  dsimp [a]
  have h_empty : { m : ℕ | 0 < m ∧ 0 ∣ m ∧ ∀ d ∈ Nat.digits 10 m, d = 0 ∨ d = 1 } = ∅ := by
    ext m
    simp only [Set.mem_ofPred_eq, Set.mem_empty_iff_false, iff_false, not_and]
    intro hm h0dvd
    have hm0 : m = 0 := Nat.eq_zero_of_zero_dvd h0dvd
    omega
  rw [h_empty, Nat.sInf_empty]

@[category test, AMS 11]
theorem a_1 : a 1 = 1 := by
  dsimp [a]
  have h_least : IsLeast { m : ℕ | 0 < m ∧ 1 ∣ m ∧ ∀ d ∈ Nat.digits 10 m, d = 0 ∨ d = 1 } 1 := by
    refine ⟨⟨by decide, dvd_rfl, ?_⟩, fun m hm ↦ hm.1⟩
    intro d hd
    rw [Nat.digits_def' (by decide) (by decide), show (1 / 10 : ℕ) = 0 by rfl,
      Nat.digits_zero] at hd
    simp only [show 1 % 10 = 1 by rfl, List.mem_singleton] at hd
    subst hd
    exact Or.inr rfl
  exact h_least.csInf_eq

@[category test, AMS 11]
theorem a_2 : a 2 = 10 := by
  dsimp [a]
  have h_least : IsLeast { m : ℕ | 0 < m ∧ 2 ∣ m ∧ ∀ d ∈ Nat.digits 10 m, d = 0 ∨ d = 1 } 10 := by
    refine ⟨⟨by decide, by decide, ?_⟩, ?_⟩
    · intro d hd
      have h10 : (10 : ℕ) = 10 ^ 1 * 1 := by rfl
      nth_rw 2 [h10] at hd
      rw [Nat.digits_base_pow_mul (b := 10) (k := 1) (m := 1) (by decide) (by decide),
          Nat.digits_of_lt 10 1 (by decide) (by decide)] at hd
      simp only [List.replicate_one, List.singleton_append, List.mem_cons,
        List.not_mem_nil, or_false] at hd
      exact hd
    · intro m hm
      by_contra! hlt
      have hm_pos : 0 < m := hm.1
      have h2dvd : 2 ∣ m := hm.2.1
      have hd : ∀ d ∈ Nat.digits 10 m, d = 0 ∨ d = 1 := hm.2.2
      interval_cases m
      · revert h2dvd; decide
      · have hm_d : Nat.digits 10 2 = [2] := Nat.digits_of_lt 10 2 (by decide) (by decide)
        have h_mem : 2 ∈ Nat.digits 10 2 := by rw [hm_d]; exact List.Mem.head []
        have := hd 2 h_mem; omega
      · have hm_d : Nat.digits 10 3 = [3] := Nat.digits_of_lt 10 3 (by decide) (by decide)
        have h_mem : 3 ∈ Nat.digits 10 3 := by rw [hm_d]; exact List.Mem.head []
        have := hd 3 h_mem; omega
      · have hm_d : Nat.digits 10 4 = [4] := Nat.digits_of_lt 10 4 (by decide) (by decide)
        have h_mem : 4 ∈ Nat.digits 10 4 := by rw [hm_d]; exact List.Mem.head []
        have := hd 4 h_mem; omega
      · have hm_d : Nat.digits 10 5 = [5] := Nat.digits_of_lt 10 5 (by decide) (by decide)
        have h_mem : 5 ∈ Nat.digits 10 5 := by rw [hm_d]; exact List.Mem.head []
        have := hd 5 h_mem; omega
      · have hm_d : Nat.digits 10 6 = [6] := Nat.digits_of_lt 10 6 (by decide) (by decide)
        have h_mem : 6 ∈ Nat.digits 10 6 := by rw [hm_d]; exact List.Mem.head []
        have := hd 6 h_mem; omega
      · have hm_d : Nat.digits 10 7 = [7] := Nat.digits_of_lt 10 7 (by decide) (by decide)
        have h_mem : 7 ∈ Nat.digits 10 7 := by rw [hm_d]; exact List.Mem.head []
        have := hd 7 h_mem; omega
      · have hm_d : Nat.digits 10 8 = [8] := Nat.digits_of_lt 10 8 (by decide) (by decide)
        have h_mem : 8 ∈ Nat.digits 10 8 := by rw [hm_d]; exact List.Mem.head []
        have := hd 8 h_mem; omega
      · have hm_d : Nat.digits 10 9 = [9] := Nat.digits_of_lt 10 9 (by decide) (by decide)
        have h_mem : 9 ∈ Nat.digits 10 9 := by rw [hm_d]; exact List.Mem.head []
        have := hd 9 h_mem; omega
  exact h_least.csInf_eq

/-- $a(10^k) = 10^k$ for all $k$. -/
@[category textbook, AMS 11]
theorem a_ten_pow (k : ℕ) : a (10 ^ k) = 10 ^ k := by
  dsimp [a]
  have h_least : IsLeast { m : ℕ | 0 < m ∧ 10 ^ k ∣ m ∧ ∀ d ∈ Nat.digits 10 m, d = 0 ∨ d = 1 } (10 ^ k) := by
    refine ⟨⟨Nat.pow_pos (by decide), dvd_rfl, ?_⟩, fun m hm ↦ Nat.le_of_dvd hm.1 hm.2.1⟩
    intro d hd
    have h10k : 10 ^ k = 10 ^ k * 1 := by rw [mul_one]
    rw [h10k, Nat.digits_base_pow_mul (b := 10) (k := k) (m := 1) (by decide) (by decide),
        Nat.digits_of_lt 10 1 (by decide) (by decide)] at hd
    simp only [List.mem_append, List.mem_replicate, List.mem_singleton] at hd
    rcases hd with ⟨-, rfl⟩ | rfl
    · exact Or.inl rfl
    · exact Or.inr rfl
  exact h_least.csInf_eq

/--
It is known that $a(10^k - 1) = (10^{9k} - 1) / 9$ for all $k$.
Is $a(n) < a(10^k - 1)$ for all $n < 10^k - 1$?
- David Radcliffe, Aug 01 2025
-/
@[category research open, AMS 11]
theorem conjecture (k : ℕ) :
    ∀ n < 10 ^ k - 1, a n < a (10 ^ k - 1) := by
  sorry

end OeisA4290

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

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