/-
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 FormalConjecturesUtilSequence $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 OeisA190363right 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⊢ √(↑n ^ 2 * (5 / 4)) < √((↑k + 1) ^ 2)
exact Real.sqrt_lt_sqrt (by 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) positivity All goals completed! 🐙) h2The 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 / 4
@[category test, AMS 11]
theorem a_1 : a 1 = 3 := by ⊢ a 1 = 3
have h := floor_mul_sqrt_five_div_four 1 1 (by ⊢ ↑1 ^ 2 ≤ ↑1 ^ 2 * (5 / 4) h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ a 1 = 3 norm_num All goals completed! 🐙 h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ a 1 = 3) (by ⊢ ↑1 ^ 2 * (5 / 4) < (↑1 + 1) ^ 2 h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ a 1 = 3 norm_num All goals completed! 🐙 h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ a 1 = 3) h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ a 1 = 3
unfold a h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ 2 * 1 + ⌊↑1 * √(5 / 4)⌋.toNat + 1 / 4 = 3
rw [h h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ 2 * 1 + (↑1).toNat + 1 / 4 = 3 h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ 2 * 1 + (↑1).toNat + 1 / 4 = 3] h:⌊↑1 * √(5 / 4)⌋ = ↑1⊢ 2 * 1 + (↑1).toNat + 1 / 4 = 3
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_2 : a 2 = 6 := by ⊢ a 2 = 6
have h := floor_mul_sqrt_five_div_four 2 2 (by ⊢ ↑2 ^ 2 ≤ ↑2 ^ 2 * (5 / 4) h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ a 2 = 6 norm_num All goals completed! 🐙 h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ a 2 = 6) (by ⊢ ↑2 ^ 2 * (5 / 4) < (↑2 + 1) ^ 2 h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ a 2 = 6 norm_num All goals completed! 🐙 h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ a 2 = 6) h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ a 2 = 6
unfold a h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ 2 * 2 + ⌊↑2 * √(5 / 4)⌋.toNat + 2 / 4 = 6
rw [h h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ 2 * 2 + (↑2).toNat + 2 / 4 = 6 h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ 2 * 2 + (↑2).toNat + 2 / 4 = 6] h:⌊↑2 * √(5 / 4)⌋ = ↑2⊢ 2 * 2 + (↑2).toNat + 2 / 4 = 6
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_3 : a 3 = 9 := by ⊢ a 3 = 9
have h := floor_mul_sqrt_five_div_four 3 3 (by ⊢ ↑3 ^ 2 ≤ ↑3 ^ 2 * (5 / 4) h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ a 3 = 9 norm_num All goals completed! 🐙 h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ a 3 = 9) (by ⊢ ↑3 ^ 2 * (5 / 4) < (↑3 + 1) ^ 2 h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ a 3 = 9 norm_num All goals completed! 🐙 h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ a 3 = 9) h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ a 3 = 9
unfold a h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ 2 * 3 + ⌊↑3 * √(5 / 4)⌋.toNat + 3 / 4 = 9
rw [h h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ 2 * 3 + (↑3).toNat + 3 / 4 = 9 h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ 2 * 3 + (↑3).toNat + 3 / 4 = 9] h:⌊↑3 * √(5 / 4)⌋ = ↑3⊢ 2 * 3 + (↑3).toNat + 3 / 4 = 9
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_4 : a 4 = 13 := by ⊢ a 4 = 13
have h := floor_mul_sqrt_five_div_four 4 4 (by ⊢ ↑4 ^ 2 ≤ ↑4 ^ 2 * (5 / 4) h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ a 4 = 13 norm_num All goals completed! 🐙 h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ a 4 = 13) (by ⊢ ↑4 ^ 2 * (5 / 4) < (↑4 + 1) ^ 2 h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ a 4 = 13 norm_num All goals completed! 🐙 h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ a 4 = 13) h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ a 4 = 13
unfold a h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ 2 * 4 + ⌊↑4 * √(5 / 4)⌋.toNat + 4 / 4 = 13
rw [h h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ 2 * 4 + (↑4).toNat + 4 / 4 = 13 h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ 2 * 4 + (↑4).toNat + 4 / 4 = 13] h:⌊↑4 * √(5 / 4)⌋ = ↑4⊢ 2 * 4 + (↑4).toNat + 4 / 4 = 13
rfl All goals completed! 🐙
@[category test, AMS 11]
theorem a_5 : a 5 = 16 := by ⊢ a 5 = 16
have h := floor_mul_sqrt_five_div_four 5 5 (by ⊢ ↑5 ^ 2 ≤ ↑5 ^ 2 * (5 / 4) h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ a 5 = 16 norm_num All goals completed! 🐙 h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ a 5 = 16) (by ⊢ ↑5 ^ 2 * (5 / 4) < (↑5 + 1) ^ 2 h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ a 5 = 16 norm_num All goals completed! 🐙 h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ a 5 = 16) h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ a 5 = 16
unfold a h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ 2 * 5 + ⌊↑5 * √(5 / 4)⌋.toNat + 5 / 4 = 16
rw [h h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ 2 * 5 + (↑5).toNat + 5 / 4 = 16 h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ 2 * 5 + (↑5).toNat + 5 / 4 = 16] h:⌊↑5 * √(5 / 4)⌋ = ↑5⊢ 2 * 5 + (↑5).toNat + 5 / 4 = 16
rfl 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 := by ⊢ ¬∀ (n : ℕ),
1 ≤ n → ↑(OeisA190363.a (n + 21)) = ↑(OeisA190363.a (n + 17)) + ↑(OeisA190363.a (n + 4)) - ↑(OeisA190363.a n)
sorry All goals completed! 🐙end OeisA190363