OFFSET
1,3
COMMENTS
a(n) = x = either ceiling or floor of n/phi, according to which minimizes abs(x/(n-x) - phi).
Each term is equal to or one greater than the previous term.
The average run length approaches phi.
The 4 following statements are equivalent for any real n and any function f(x) such that for any real x, f(x) equals an integer within the range (x-1,x+1) (e.g., round(x), ceiling(x), floor(x)):
.
Let s(n) = (phi*n - 1 - sqrt(1+(n^2)*(phi^-4)))/2.
Floor(s(n)) equals the number of times that a(n) swapped from being equal to floor(n/phi) to being equal to ceiling(n/phi) when n is extended to the reals.
This is true because s(n) is the solution to the equation n = (phi/4)(phi(2w+1)+sqrt((2w+1)^2 * phi^-4 + 4/phi)) solved for w. The equation gives the n-value of w-th swap from a(n) = floor(n/phi) to a(n) = ceiling(n/phi).
s(n) is asymptotic to n/phi - 1/2.
floor(s(n)) != floor(n/phi - 1/2) <-> a(n) != round(n).
Floor(n/phi) equals the number of times that a(n) swapped from being equal to ceiling(n/phi) to being equal to floor(n/phi) when n is extended to the reals.
FORMULA
a(n) = n - A371626(n).
a(n) = ceiling(n/phi) if floor(s(n)) + floor(n/phi) is even.
a(n) = floor(n/phi) if floor(s(n)) + floor(n/phi) is odd.
a(n) = ceiling(n/phi) - (floor(s(n))+floor(n/phi) mod 2).
a(n) = round(n/phi) + floor(s(n)) - floor(n/phi+1/2)
EXAMPLE
For n=5, the possibilities are (0,5), (1,4), (2,3), (3,2), & (4,1). Of those, 3/2 is the closest to phi, so a(5)=3.
CROSSREFS
KEYWORD
nonn
AUTHOR
Colin Linzer, Mar 29 2024
STATUS
approved