{
  "id": "6389",
  "ident": "NS.06389",
  "slug": "oeis-37274",
  "title": "Home primes (OEIS A037274)",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Every integer at least two reaches a home prime.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA37274.home_prime_conjecture",
  "statement_lean": "theorem home_prime_conjecture : ∀ n : ℕ, 2 ≤ n → ReachesPrime n",
  "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# Home primes (OEIS A037274)\n\nStarting from an integer $n\\geq 2$, list its prime factors in nondecreasing order with\nmultiplicity, concatenate their decimal representations, and repeat. The home-prime conjecture\nsays that this process always reaches a prime.\n\nFor example,\n\n$$25 \\longmapsto 55 \\longmapsto 511 \\longmapsto 773.$$\n\n*References:*\n* [OEIS A037274](https://oeis.org/A037274)\n* M. Herman and J. Schiffman, *Investigating home primes and their families*,\n  Mathematics Teacher 107 (2014), 606–614\n-/\n\n@[expose] public section\n\nnamespace OeisA37274\n\n/-- The number of decimal digits of a natural number, counting zero as one digit. -/\ndef decimalDigitCount (n : ℕ) : ℕ :=\n  if n = 0 then 1 else (Nat.digits 10 n).length\n\n/-- Append the decimal digits of `b` to those of `a`. -/\ndef decimalAppend (a b : ℕ) : ℕ :=\n  a * 10 ^ decimalDigitCount b + b\n\n/-- Concatenate the prime factors of `n` in nondecreasing order, retaining multiplicity. -/\ndef primeFactorSplice (n : ℕ) : ℕ :=\n  n.primeFactorsList.foldl decimalAppend 0\n\n/-- A starting value reaches a prime after finitely many prime-factor splicing steps. -/\ndef ReachesPrime (n : ℕ) : Prop :=\n  ∃ k : ℕ, ((primeFactorSplice^[k]) n).Prime\n\n/-- Every integer at least two reaches a home prime. -/\n@[category research open, AMS 11]\ntheorem home_prime_conjecture : ∀ n : ℕ, 2 ≤ n → ReachesPrime n := by\n  sorry\n\n/-- The first step in the trajectory from $25$ is $25\\mapsto55$. -/\n@[category test, AMS 11]\ntheorem primeFactorSplice_25 : primeFactorSplice 25 = 55 := by\n  norm_num [primeFactorSplice, decimalAppend, decimalDigitCount, Nat.primeFactorsList]\n\n/-- The second step in the trajectory from $25$ is $55\\mapsto511$. -/\n@[category test, AMS 11]\ntheorem primeFactorSplice_55 : primeFactorSplice 55 = 511 := by\n  norm_num [primeFactorSplice, decimalAppend, decimalDigitCount, Nat.primeFactorsList]\n\n/-- The third step in the trajectory from $25$ is $511\\mapsto773$. -/\n@[category test, AMS 11]\ntheorem primeFactorSplice_511 : primeFactorSplice 511 = 773 := by\n  norm_num [primeFactorSplice, decimalAppend, decimalDigitCount, Nat.primeFactorsList]\n\n/-- A prime is a fixed point of prime-factor splicing. -/\n@[category test, AMS 11]\ntheorem primeFactorSplice_prime {p : ℕ} (hp : p.Prime) : primeFactorSplice p = p := by\n  simp [primeFactorSplice, Nat.primeFactorsList_prime hp, decimalAppend]\n\n/-- The trajectory from $25$ reaches the prime $773$ after three steps. -/\n@[category test, AMS 11]\ntheorem reachesPrime_25 : ReachesPrime 25 := by\n  refine ⟨3, ?_⟩\n  norm_num [Function.iterate_succ_apply, primeFactorSplice, decimalAppend, decimalDigitCount,\n    Nat.primeFactorsList]\n\nend OeisA37274\n",
  "statement_hash": "23db9178e53c0c689e09597cf080e90ab2bcc74f3d5dcb9ebe7891903575f1ec",
  "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."
}