/- 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. -/ import FormalConjecturesUtil

Bounds on fractional parts $n r^2 - a(n)$ for $r = (2+\sqrt{5})/2$

$a(n) = \lfloor r \cdot \lfloor r \cdot n \rfloor \rfloor$, where $r = (2 + \sqrt{5})/2$.

References:

    A341254

    arxiv/2605.22763 Advancing Mathematics Research with AI-Driven Formal Proof Search by George Tsoukalas et al.

namespace OeisA341254open Real

The constant $r = (2 + \sqrt{5})/2$.

noncomputable def rConst : := (2 + sqrt 5) / 2

The constant $r^2$.

noncomputable def rSq : := rConst * rConst

$a(n) = \lfloor r \cdot \lfloor r \cdot n \rfloor \rfloor$, where $r = (2 + \sqrt{5})/2$. Note: The original OEIS definition has $n$ starting at 1. We define $a(n)$ for all $\mathbb{N}$.

noncomputable def a (n : ) : := let r := rConst let inner_floor : := Int.floor (r * n) (Int.floor (r * inner_floor.cast)).toNath1:(2 + 5) / 2 = 2h2:(2 + 5) / 2 * 2 = 4Int.toNat 4 = 4 All goals completed! 🐙h1:(2 + 5) / 2 * 2 = 4h2:(2 + 5) / 2 * 4 = 8Int.toNat 8 = 8 All goals completed! 🐙h1:(2 + 5) / 2 * 3 = 6h2:(2 + 5) / 2 * 6 = 12Int.toNat 12 = 12 All goals completed! 🐙h1:(2 + 5) / 2 * 4 = 8h2:(2 + 5) / 2 * 8 = 16Int.toNat 16 = 16 All goals completed! 🐙h1:(2 + 5) / 2 * 5 = 10h2:(2 + 5) / 2 * 10 = 21Int.toNat 21 = 21 All goals completed! 🐙

Conjecture: $1/4 < n r^2 - a(n) < 3$ for $n \ge 1$, where $r = (2 + \sqrt{5})/2$.

A formal proof has been found with the methods described in arxiv/2605.22763.

@[category research solved, AMS 11, formal_proof using formal_conjectures at "https://github.com/mo271/formal-conjectures/blob/a32396489dcb8f86c3549b93aa358ac6a10a3a1f/FormalConjectures/OEIS/341254.wip.lean#L188"] theorem a_bounds (n : ) (hn : 1 n) : (1 / 4 : ) < (n : ) * rSq - (a n : ) (n : ) * rSq - (a n : ) < 3 := n:hn:1 n1 / 4 < n * rSq - (a n) n * rSq - (a n) < 3 All goals completed! 🐙end OeisA341254