OFFSET
1,2
COMMENTS
Let b denote the sequence of n such that a(n)=a(n+1), then b(n)=floor(tau^2*n) where tau=(1+sqrt(5))/2.
Missing numbers are the nearest integer to tau^2*n, n>=0 (cf. A004937).
#{k>0 : a(k) = k} = infinity.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
F(2n) = F(2n+1) - F(n+1)^2 + F(n)*F(n-1) for n>0.
a(F(2n-1)) = F(2n)-1 for n>1.
1/tau < a(n)/n < tau.
EXAMPLE
For 5 = F(5) < k <= F(6) = 8 we get a(6) = 8-a(6-5) = 8-a(1) = 7.
a(7) = 8-a(7-5) = 8-a(2) = 6.
a(8) = 8-a(8-5) = 8-a(3) = 6.
MATHEMATICA
a[n_] := a[n] = If[n <= 1, 1, Fibonacci[(k = Floor[Log[Sqrt[5]*n]/Log[GoldenRatio]]) + 1] - a[n - Fibonacci[k]]]; Array[a, 100] (* Amiram Eldar, Jun 17 2022 *)
PROG
(PARI) f=(1+sqrt(5))/2; a(n)=if(n<2, 1, fibonacci(floor(log(sqrt(5)*n)/log(f))+1)-a(n-fibonacci(floor(log(sqrt(5)*n)/log(f)))))
CROSSREFS
KEYWORD
nonn
AUTHOR
Benoit Cloitre, May 03 2005
STATUS
approved