A309408 Start with X = F(n) = A000045(n). Repeatedly replace X with X - ceiling(X/n); a(n) is the number of steps to reach 0.
0, 1, 1, 2, 3, 5, 7, 10, 13, 18, 23, 29, 36, 44, 53, 63, 74, 85, 98, 111, 125, 140, 157, 174, 192, 211, 231, 251, 273, 296, 319, 343, 369, 395, 423, 451, 481, 510, 541, 573, 606, 640, 675, 710, 747, 785, 823, 863, 903, 944, 987, 1030, 1074, 1119, 1165, 1212, 1260, 1309, 1359, 1409, 1462, 1514, 1568, 1622, 1678, 1734, 1791
Offset: 0
Programs
-
Mathematica
f[n_] := Length[NestWhileList[# - Ceiling[#/n] &, Fibonacci[n], # > 0 &]] - 1; f /@ Range[0,70] (* Amiram Eldar, Aug 08 2019 *)
-
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
-
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
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... .
Comments