%I #30 Jan 03 2018 14:46:23
%S 0,1,2,3,3,4,4,5,4,4,5,6,5,6,6,5,5,6,5,6,6,6,7,8,6,5,7,5,7,8,6,7,6,7,
%T 7,6,6,7,7,7,7,8,7,8,8,6,9,10,7,6,6,7,8,9,6,7,8,7,9,10,7,8,8,7,7,7,8,
%U 9,8,9,7,8,7,8,8,6,8,7,8,9,8,6,9,10,8,7
%N Number of iterations of A220096 required to reach 0 starting from n.
%C Records occur at indices 0, 1, 2, 3, 5, 7, 11, 22, 23, 46, 47, 94, ... (see A297026).
%H Peter Kagey, <a href="/A297025/b297025.txt">Table of n, a(n) for n = 0..10000</a>
%e For n = 14, a(14) = 6 because six iterations are required to reach zero:
%e A220096(14) = 7,
%e A220096(7) = 6,
%e A220096(6) = 3,
%e A220096(3) = 2,
%e A220096(2) = 1, and
%e A220096(1) = 0.
%t g[n_Integer] := If[n == 1, 0, Block[{fi = FactorInteger@ n}, If[Plus @@ (Last@# & /@ FactorInteger@n) == 1, n -1, n/fi[[1, 1]] ]]]; f[n_] := Length@ NestWhileList[g, n, # > 0 &] -1; Array[f, 86, 0] (* _Robert G. Wilson v_, Dec 24 2017 *)
%o (PARI) f(n) = if (n==1, 0, isprime(n), n-1, my(d=divisors(n)); d[#d-1]);
%o a(n) = my(nb = 0); while (n, n = f(n); nb++); nb; \\ _Michel Marcus_, Dec 24 2017
%Y Cf. A220096. Positions of records at A297026.
%Y Cf. A056792, A061282, A260112.
%K nonn
%O 0,3
%A _Peter Kagey_ and _Alec Jones_, Dec 24 2017