OFFSET
0,4
COMMENTS
Inspired by A278586.
FORMULA
Lim_{n -> inf} (a(n)/(n^2)) = log(phi) = A002390.
a(n) = n^2*log(phi) - n*log(n) + O(n), phi = (1+sqrt(5))/2.
Lim_{n -> inf} (a(n) - n^2*log(phi) + n*log(n))/ n = -0.4681... .
MATHEMATICA
f[n_] := Length[NestWhileList[# - Ceiling[#/n] &, Fibonacci[n], # > 0 &]] - 1; f /@ Range[0, 70] (* Amiram Eldar, Aug 08 2019 *)
PROG
(Python)
n, f1, f0 = 0, 0, 1
while n <= 20000:
fn, a = f1, 0
while fn > 0:
fn, a = fn - (fn+n-1)//n, a+1
print(n, a)
n, f1, f0 = n+1, f0, f1+f0
(PARI) f(x, n) = x - ceil(x/n);
a(n) = my(nb=0, x=fibonacci(n)); while(x, x = f(x, n); nb++); nb; \\ Michel Marcus, Aug 03 2019
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
A.H.M. Smeets, Jul 29 2019
STATUS
approved