{
  "id": "5912",
  "ident": "NS.05912",
  "slug": "oeis-250131",
  "title": "Odd part of the digital sum of $3^n$ divided by the maximal power of $3$",
  "status": "open",
  "statement_status": "reviewed",
  "statement_md": "Conjecture: Consider the sequence $b(n)$ such that $b(1)=2$, $b(2)=3$, and for $n \\ge 3$,\n$b(n)=a(n-2)$. If we apply the Eratosthenes-like sieve to $b(n)$ and remove $1$s, then we obtain\na sequence of primes.\n- _Vladimir Shevelev_, Dec 12 2014",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA250131.conjecture_1",
  "statement_lean": "theorem conjecture_1 : ∀ n ∈ sievedIndices, (b n).Prime",
  "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# Odd part of the digital sum of $3^n$ divided by the maximal power of $3$\n\nThe sequence $a(n)$ is the odd part of the base-$10$ digital sum of $3^n$ divided by the maximal\npossible power of $3$.\n\n*References:*\n- [A250131](https://oeis.org/A250131)\n-/\n\n@[expose] public section\n\nnamespace OeisA250131\n\nopen Nat\n\n/-- The odd part of the digital sum of $3^n$ divided by the maximal possible power of $3$. -/\ndef a (n : ℕ) : ℕ :=\n  let d := (Nat.digits 10 (3 ^ n)).sum\n  let v3 := padicValNat 3 d\n  let v2 := padicValNat 2 d\n  d / (3 ^ v3 * 2 ^ v2)\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 1 := by decide +kernel\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 1 := by decide +kernel\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 1 := by decide +kernel\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 1 := by decide +kernel\n\n@[category test, AMS 11]\ntheorem a_14 : a 14 = 5 := by decide +kernel\n\n/-- Auxiliary sequence $b(n)$ related to A250131: $b(1)=2$, $b(2)=3$, and $b(n)=a(n-2)$ for\n$n \\ge 3$. -/\ndef b (n : ℕ) : ℕ :=\n  match n with\n  | 0 => 0\n  | 1 => 2\n  | 2 => 3\n  | n' + 3 => a (n' + 1)\n\n/-- The set of indices $n \\ge 1$ such that $b(n) \\ne 1$ and $b(n)$ is not a multiple of any $b(k)$\nfor $1 \\le k < n$ where $b(k) \\ne 1$. This formalizes the Eratosthenes-like sieve applied to $b(n)$\nafter removing $1$s. -/\ndef sievedIndices : Set ℕ :=\n  { n | 1 ≤ n ∧ b n ≠ 1 ∧ ∀ k, (1 ≤ k ∧ k < n ∧ b k ≠ 1) → ¬ (b k ∣ b n) }\n\n/--\nConjecture: Consider the sequence $b(n)$ such that $b(1)=2$, $b(2)=3$, and for $n \\ge 3$,\n$b(n)=a(n-2)$. If we apply the Eratosthenes-like sieve to $b(n)$ and remove $1$s, then we obtain\na sequence of primes.\n- _Vladimir Shevelev_, Dec 12 2014\n-/\n@[category research open, AMS 11]\ntheorem conjecture_1 : ∀ n ∈ sievedIndices, (b n).Prime := by\n  sorry\n\n/--\nStronger variant: the sieved sequence $b(n)$ yields the set of all primes (in some perturbed\norder).\n\nNote: This stronger statement is not explicitly written on the [A250131](https://oeis.org/A250131)\nOEIS page (which only states `conjecture_1` and notes via _Peter J. C. Moses_ that \"these primes\nfollow with some perturbation of order\"), but is implied by prepending $b(1)=2, b(2)=3$ (which\notherwise have no effect on the sieve since $\\gcd(a(n), 6) = 1$) and by _Vladimir Shevelev_'s\nanalogous conjecture in the cross-referenced entries [A221858](https://oeis.org/A221858) and\n[A225039](https://oeis.org/A225039).\n-/\n@[category research open, AMS 11]\ntheorem conjecture_2 : b '' sievedIndices = {p : ℕ | p.Prime} := by\n  sorry\n\nend OeisA250131\n",
  "statement_hash": "a6d9525003963dadf84f368cd63c12b0bcddf025366a9cad7b1dd62e1483054d",
  "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."
}