{
  "id": "5159",
  "ident": "NS.05159",
  "slug": "oeis-190363",
  "title": "Sequence $a(n) = n + \\lfloor n r / t \\rfloor + \\lfloor n s / t \\rfloor$",
  "status": "solved",
  "statement_status": "reviewed",
  "statement_md": "Conjecture: $a(n)$ satisfies the linear recurrence with constant coefficients\n$0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1$, i.e.,\n$a(n + 21) = a(n + 17) + a(n + 4) - a(n)$ for $n \\ge 1$.\n- _Harvey P. Dale_, Jan 28 2025\n\nThe conjecture is false: the recurrence first fails at $n = 140$, i.e. for the term\n$a(140 + 21) = a(161) = 542 \\ne 541 = a(157) + a(144) - a(140)$.\n\nSince\n$\\lim_{n\\to\\infty} \\frac{a(n)}{n} = \\frac{9}{4} + \\frac{\\sqrt{5}}{2}$ is irrational,\nno linear recurrence with constant integer coefficients can hold. Indeed, it follows\nfrom known results that if $a(n)$ satisfies a linear recurrence with constant integer coefficients\nand $\\lim_{n \\to \\infty} \\frac{a_n}{n} = \\alpha$ exists, then $\\alpha$ must be rational.",
  "subjects": [
    "math.NT",
    "msc:11"
  ],
  "tags": [],
  "collection": "oeis",
  "source_url": null,
  "solved_on_platform": false,
  "needs_answer": false,
  "version": 1,
  "decl_name": "OeisA190363.conjecture",
  "statement_lean": "theorem conjecture :\n    ¬ ∀ n : ℕ, 1 ≤ n → (a (n + 21) : ℤ) = a (n + 17) + a (n + 4) - a 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# Sequence $a(n) = n + \\lfloor n r / t \\rfloor + \\lfloor n s / t \\rfloor$\n\nThe sequence $a(n)$ is given by $a(n) = n + \\lfloor n r / t \\rfloor + \\lfloor n s / t \\rfloor$\nwhere $r = 1$, $s = \\sqrt{5/4}$, and $t = \\sqrt{4/5}$. Equivalently,\n$$a(n) = 2n + \\lfloor n \\sqrt{5/4} \\rfloor + \\lfloor n/4 \\rfloor.$$\n\n*References:*\n- [A190363](https://oeis.org/A190363)\n-/\n\n@[expose] public section\n\nnamespace OeisA190363\n\n@[category API, AMS 11]\nprivate lemma floor_mul_sqrt_five_div_four (n k : ℕ)\n    (h1 : (k : ℝ) ^ 2 ≤ (n : ℝ) ^ 2 * (5 / 4))\n    (h2 : (n : ℝ) ^ 2 * (5 / 4) < ((k : ℝ) + 1) ^ 2) :\n    Int.floor ((n : ℝ) * Real.sqrt (5 / 4)) = k := by\n  rw [Int.floor_eq_iff]\n  have hn : (0 : ℝ) ≤ n := Nat.cast_nonneg n\n  have hk : (0 : ℝ) ≤ k := Nat.cast_nonneg k\n  have h_eq : (n : ℝ) * Real.sqrt (5 / 4) = Real.sqrt ((n : ℝ) ^ 2 * (5 / 4)) := by\n    rw [Real.sqrt_mul (sq_nonneg _), Real.sqrt_sq hn]\n  rw [h_eq, Int.cast_natCast]\n  constructor\n  · rw [← Real.sqrt_sq hk]\n    exact Real.sqrt_le_sqrt h1\n  · have hk1 : (0 : ℝ) ≤ (k : ℝ) + 1 := by positivity\n    rw [← Real.sqrt_sq hk1]\n    exact Real.sqrt_lt_sqrt (by positivity) h2\n\n/--\nThe sequence $a(n) = 2n + \\lfloor n \\sqrt{5/4} \\rfloor + \\lfloor n/4 \\rfloor$.\n-/\nnoncomputable def a (n : ℕ) : ℕ :=\n  2 * n + (Int.floor ((n : ℝ) * Real.sqrt (5 / 4))).toNat + n / 4\n\n@[category test, AMS 11]\ntheorem a_1 : a 1 = 3 := by\n  have h := floor_mul_sqrt_five_div_four 1 1 (by norm_num) (by norm_num)\n  unfold a\n  rw [h]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_2 : a 2 = 6 := by\n  have h := floor_mul_sqrt_five_div_four 2 2 (by norm_num) (by norm_num)\n  unfold a\n  rw [h]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_3 : a 3 = 9 := by\n  have h := floor_mul_sqrt_five_div_four 3 3 (by norm_num) (by norm_num)\n  unfold a\n  rw [h]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_4 : a 4 = 13 := by\n  have h := floor_mul_sqrt_five_div_four 4 4 (by norm_num) (by norm_num)\n  unfold a\n  rw [h]\n  rfl\n\n@[category test, AMS 11]\ntheorem a_5 : a 5 = 16 := by\n  have h := floor_mul_sqrt_five_div_four 5 5 (by norm_num) (by norm_num)\n  unfold a\n  rw [h]\n  rfl\n\n/--\nConjecture: $a(n)$ satisfies the linear recurrence with constant coefficients\n$0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1$, i.e.,\n$a(n + 21) = a(n + 17) + a(n + 4) - a(n)$ for $n \\ge 1$.\n- _Harvey P. Dale_, Jan 28 2025\n\nThe conjecture is false: the recurrence first fails at $n = 140$, i.e. for the term\n$a(140 + 21) = a(161) = 543 \\ne 542 = a(157) + a(144) - a(140)$.\n\nSince\n$\\lim_{n\\to\\infty} \\frac{a(n)}{n} = \\frac{9}{4} + \\frac{\\sqrt{5}}{2}$ is irrational,\nno linear recurrence with constant integer coefficients can hold. Indeed, it follows\nfrom known results that if $a(n)$ satisfies a linear recurrence with constant integer coefficients\nand $\\lim_{n \\to \\infty} \\frac{a_n}{n} = \\alpha$ exists, then $\\alpha$ must be rational.\n-/\n@[category research solved, AMS 11]\ntheorem conjecture :\n    ¬ ∀ n : ℕ, 1 ≤ n → (a (n + 21) : ℤ) = a (n + 17) + a (n + 4) - a n := by\n  sorry\n\nend OeisA190363\n",
  "statement_hash": "cc549c4816cc8f34934dcc2bd803c6bdd7f886ddf4f266ffd30851ab518c7fb8",
  "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."
}