OFFSET
1,2
COMMENTS
Old name was a(n) = last number in repeating block in continued fraction for n*phi.
REFERENCES
Alfred Brousseau, Fibonacci and Related Number Theoretic Tables, The Fibonacci Association, 1972, 101-103.
LINKS
Clark Kimberling, Table of n, a(n) for n = 1..1000
J.-P. Allouche and F. M. Dekking, Generalized Beatty sequences and complementary triples, arXiv:1809.03424 [math.NT], 2018.
FORMULA
a(n) = -n + 2*floor(n*phi) = A283233(n)-n.
a(n) = floor(n*phi) + floor(n*sigma) where phi = (sqrt(5)+1)/2 and sigma = (sqrt(5)-1)/2.
a(n) = last number in repeating block in continued fraction for n*phi.
MATHEMATICA
Table[-n+2Floor[n*GoldenRatio], {n, 1, 100}]
PROG
(PARI) for(n=1, 50, print1(-n + 2*floor(n*(1+sqrt(5))/2), ", ")) \\ G. C. Greubel, Oct 15 2017
(Magma) [-n + 2*Floor(n*(1+Sqrt(5))/2): n in [1..50]]; // G. C. Greubel, Oct 15 2017
(Python)
def A050140(n): return (n+isqrt(5*n**2)&-2)-n # Chai Wah Wu, Aug 25 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
EXTENSIONS
Formula and more terms from Vladeta Jovovic, Nov 23 2001
Name changed by Michel Dekking, Dec 27 2017
STATUS
approved