OFFSET
1,12
COMMENTS
The Fibonacci numbers are the fixed points of the map, since z(Fibonacci(k)) = 1 for all k >= 1. Therefore they are arbitrarily assigned the value a(Fibonacci(k)) = 0.
Each number n starts a chain of a(n) integers: n, n/z(n), (n/z(n))/z(n/z(n)), ..., of them the first a(n)-1 integers are Zeckendorf-Niven numbers (A328208).
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
a(12) = 2 since 12/z(12) = 4 and 4/z(4) = 2 is a Fibonacci number that is reached after 2 iterations.
a(36) = 3 since 36/z(36) = 18, 18/z(18) = 9 and 9/z(9) = 9/2 is a noninteger that is reached after 3 iterations.
MATHEMATICA
zeck[n_] := Length[DeleteCases[NestWhileList[# - Fibonacci[Floor[Log[Sqrt[5]*# + 3/2]/Log[GoldenRatio]]] &, n, # > 1 &], 0]]; (* Alonso del Arte at A007895 *)
a[n_] := a[n] = Module[{z = zeck[n]}, If[z == 1, 0, If[!Divisible[n, z], 1, 1 + a[n/z]]]]; Array[a, 100]
PROG
(PARI) zeck(n) = if(n<4, n>0, my(k=2, s, t); while(fibonacci(k++)<=n, ); while(k && n, t=fibonacci(k); if(t<=n, n-=t; s++); k--); s) \\ Charles R Greathouse IV at A007895
a(n) = {my(z = zeck(n)); if(z == 1, 0, if(n % z, 1, 1 + a(n/z))); }
CROSSREFS
KEYWORD
nonn,easy,base,new
AUTHOR
Amiram Eldar, Oct 20 2024
STATUS
approved