/- Copyright 2026 The Formal Conjectures Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at https://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. -/ module public import FormalConjecturesUtil

Sequence $a(n) = n + \lfloor n r / t \rfloor + \lfloor n s / t \rfloor$

The sequence $a(n)$ is given by $a(n) = n + \lfloor n r / t \rfloor + \lfloor n s / t \rfloor$ where $r = 1$, $s = \sqrt{5/4}$, and $t = \sqrt{4/5}$. Equivalently, $$a(n) = 2n + \lfloor n \sqrt{5/4} \rfloor + \lfloor n/4 \rfloor.$$

References:

@[expose] public sectionnamespace OeisA190363n:ℕk:ℕh1:↑k ^ 2 ≤ ↑n ^ 2 * (5 / 4)h2:↑n ^ 2 * (5 / 4) < (↑k + 1) ^ 2hn:0 ≤ ↑nhk:0 ≤ ↑kh_eq:↑n * √(5 / 4) = √(↑n ^ 2 * (5 / 4))hk1:0 ≤ ↑k + 1⊢ √(↑n ^ 2 * (5 / 4)) < √((↑k + 1) ^ 2) exact Real.sqrt_lt_sqrt (n:ℕk:ℕh1:↑k ^ 2 ≤ ↑n ^ 2 * (5 / 4)h2:↑n ^ 2 * (5 / 4) < (↑k + 1) ^ 2hn:0 ≤ ↑nhk:0 ≤ ↑kh_eq:↑n * √(5 / 4) = √(↑n ^ 2 * (5 / 4))hk1:0 ≤ ↑k + 1⊢ 0 ≤ ↑n ^ 2 * (5 / 4) All goals completed! 🐙) h2

The sequence $a(n) = 2n + \lfloor n \sqrt{5/4} \rfloor + \lfloor n/4 \rfloor$.

noncomputable def a (n : ℕ) : ℕ := 2 * n + (Int.floor ((n : ℝ) * Real.sqrt (5 / 4))).toNat + n / 4h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ 2 * 1 + (↑1).toNat + 1 / 4 = 3 All goals completed! 🐙h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ 2 * 2 + (↑2).toNat + 2 / 4 = 6 All goals completed! 🐙h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ 2 * 3 + (↑3).toNat + 3 / 4 = 9 All goals completed! 🐙h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ 2 * 4 + (↑4).toNat + 4 / 4 = 13 All goals completed! 🐙h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ 2 * 5 + (↑5).toNat + 5 / 4 = 16 All goals completed! 🐙

Conjecture: $a(n)$ satisfies the linear recurrence with constant coefficients $0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0, -1$, i.e., $a(n + 21) = a(n + 17) + a(n + 4) - a(n)$ for $n \ge 1$.

    Harvey P. Dale, Jan 28 2025

The conjecture is false: the recurrence first fails at $n = 140$, i.e. for the term $a(140 + 21) = a(161) = 543 \ne 542 = a(157) + a(144) - a(140)$.

Since $\lim_{n\to\infty} \frac{a(n)}{n} = \frac{9}{4} + \frac{\sqrt{5}}{2}$ is irrational, no linear recurrence with constant integer coefficients can hold. Indeed, it follows from known results that if $a(n)$ satisfies a linear recurrence with constant integer coefficients and $\lim_{n \to \infty} \frac{a_n}{n} = \alpha$ exists, then $\alpha$ must be rational.

@[category research solved, AMS 11] theorem conjecture : ¬ ∀ n : ℕ, 1 ≤ n → (a (n + 21) : ℤ) = a (n + 17) + a (n + 4) - a n := ⊢ ¬∀ (n : ℕ), 1 ≤ n → ↑(OeisA190363.a (n + 21)) = ↑(OeisA190363.a (n + 17)) + ↑(OeisA190363.a (n + 4)) - ↑(OeisA190363.a n) All goals completed! 🐙end OeisA190363