{
  "id": "8489",
  "ident": "NS.08489",
  "slug": "wikipedia-smithnumber",
  "title": "McDaniel's Theorem on Smith Numbers and the Smith Brothers Problem",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "**McDaniel's Theorem (1987)**: Infinitely many base-$10$ Smith numbers exist.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "wikipedia",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "SmithNumber.mcdaniel_infinitely_many_smith_numbers",
  "statement_lean": "theorem mcdaniel_infinitely_many_smith_numbers :\n    {n : ℕ | IsSmithNumber 10 n}.Infinite",
  "challenge_source": "/-\nCopyright 2026 The Formal Conjectures Authors.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\n    https://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n-/\nmodule\n\npublic import FormalConjecturesUtil\n\n/-!\n# McDaniel's Theorem on Smith Numbers and the Smith Brothers Problem\n\nCoined by Albert Wilansky (1982), a base-$b$ *Smith number* ($b \\ge 2$; `OEIS A006753` for $b = 10$)\nis a composite integer $n$ whose base-$b$ digit sum matches the total base-$b$ digit sum across its\nprime factors with multiplicity.\n\nWayne L. McDaniel (1987) proved that base-$10$ Smith numbers form an infinite set. Adjacent\nbase-$10$ Smith numbers $(n, n + 1)$—beginning at $(728, 729)$—form *Smith brothers* (the least\nstarting term of $k$ consecutive base-$10$ Smith numbers is `OEIS A059754`); whether infinitely many\npairs of Smith brothers exist remains open.\n\n*References:*\n- [Wikipedia](https://en.wikipedia.org/wiki/Smith_number)\n- [OEIS A006753](https://oeis.org/A006753)\n- [OEIS A059754](https://oeis.org/A059754)\n- A. Wilansky, *Smith numbers*, Two-Year Coll. Math. J. **13** (1982), no. 1, 21.\n- W. L. McDaniel, *The existence of infinitely many k-Smith numbers*, Fibonacci Quart. **25**\n  (1987), no. 1, 76–80.\n-/\n\n@[expose] public section\n\nnamespace SmithNumber\n\n/-- Base-$b$ digit sum of $n$. -/\ndef digitSum (b n : ℕ) : ℕ :=\n  (Nat.digits b n).sum\n\n/-- Total base-$b$ digit sum across the prime factors of $n$ counted with multiplicity. -/\ndef primeFactorsDigitSum (b n : ℕ) : ℕ :=\n  (n.primeFactorsList.map (digitSum b)).sum\n\n/-- Predicate asserting that $n$ is composite and its base-$b$ digit sum ($b \\ge 2$) matches\n`primeFactorsDigitSum b n`. -/\ndef IsSmithNumber (b n : ℕ) : Prop :=\n  2 ≤ b ∧ n.Composite ∧ digitSum b n = primeFactorsDigitSum b n\n\ninstance (b n : ℕ) : Decidable (IsSmithNumber b n) :=\n  inferInstanceAs (Decidable (2 ≤ b ∧ n.Composite ∧ digitSum b n = primeFactorsDigitSum b n))\n\n/-- Checks the first two base-$10$ Smith numbers $4$ and $22$, the first Smith brother pair\n$(728, 729)$, and the non-examples $2$ (prime) and $6$ ($6 \\ne 2 + 3$). -/\n@[category test, AMS 11]\ntheorem smallest_smith_numbers_witness :\n    IsSmithNumber 10 4 ∧\n      IsSmithNumber 10 22 ∧\n      IsSmithNumber 10 728 ∧\n      IsSmithNumber 10 729 ∧\n      ¬ IsSmithNumber 10 2 ∧\n      ¬ IsSmithNumber 10 6 := by\n  decide +kernel\n\n/-- Excludes degenerate bases $b = 0, 1$ and inputs $n = 0, 1$, and checks `digitSum 10 4 = 4`. -/\n@[category test, AMS 11]\ntheorem smith_number_zero_one_and_four_sums :\n    ¬ IsSmithNumber 0 4 ∧\n      ¬ IsSmithNumber 1 4 ∧\n      ¬ IsSmithNumber 10 0 ∧\n      ¬ IsSmithNumber 10 1 ∧\n      digitSum 10 4 = 4 ∧\n      primeFactorsDigitSum 10 4 = 4 := by\n  decide +kernel\n\n/-- Every prime $p$ satisfies `primeFactorsDigitSum b p = digitSum b p`. -/\n@[category API, AMS 11]\ntheorem primeFactorsDigitSum_of_prime (b : ℕ) {p : ℕ} (hp : p.Prime) :\n    primeFactorsDigitSum b p = digitSum b p := by\n  rw [primeFactorsDigitSum, Nat.primeFactorsList_prime hp, List.map_singleton, List.sum_singleton]\n\n/-- No prime $p$ satisfies `IsSmithNumber b p`, since Smith numbers must be composite. -/\n@[category API, AMS 11]\ntheorem not_isSmithNumber_of_prime (b : ℕ) {p : ℕ} (hp : p.Prime) :\n    ¬ IsSmithNumber b p :=\n  fun h => h.2.1.2 hp\n\n/--\n**McDaniel's Theorem (1987)**: Infinitely many base-$10$ Smith numbers exist.\n-/\n@[category research solved, AMS 11]\ntheorem mcdaniel_infinitely_many_smith_numbers :\n    {n : ℕ | IsSmithNumber 10 n}.Infinite := by\n  sorry\n\n/--\nDo infinitely many consecutive base-$10$ Smith-number pairs $(n, n + 1)$ (Smith brothers) exist?\n-/\n@[category research open, question, AMS 11]\ntheorem infinite_smith_brothers :\n    {n : ℕ | IsSmithNumber 10 n ∧ IsSmithNumber 10 (n + 1)}.Infinite := by\n  sorry\n\nend SmithNumber\n",
  "statement_hash": "4d7e98646606ef3eca14f5b82dce94aed745c791e9d42ccc34810bb59b6f31b7",
  "toolchain": "leanprover/lean4:v4.33.1",
  "upstream_commit": "f9b3868d5ca994a7bf95039bcec05338c0c21e2f",
  "workspace": "formal-conjectures",
  "field": "math",
  "formalization": "formal",
  "verification": "lean-kernel",
  "license": "Apache-2.0",
  "attribution": "google-deepmind/formal-conjectures contributors",
  "metric_name": null,
  "metric_direction": null,
  "critiques": [],
  "public_partial_proofs": [],
  "research_threads": [],
  "instructions": "Read research_threads first: other people's public repositories and what they already tried. Write Solution.lean starting from challenge_source. Keep every definition identical, prove decl_name with exactly the same type, no sorry in its dependency closure, no new axioms, no native_decide, no metaprogramming. Submit with POST /api/v1/submissions."
}