%I #14 May 08 2019 15:48:45
%S 0,1,2,3,1,2,2,3,3,1,4,5,2,3,3,3,1,2,4,5,2,2,2,3,3,1,6,3,4,5,2,3,2,4,
%T 4,3,1,2,3,5,4,5,2,3,4,2,3,4,3,1,3,4,2,3,4,3,2,2,4,5,2,3,6,3,1,4,3,4,
%U 4,3,4,5,2,3,4,5,4,2,4,5,3,1,6,7,3,3,6,7,4,5,2,3,6,5,3,4,2,3,4,3,1,2,6,7,3
%N a(n) is the number of iterations of the integer splitting function (A056737) necessary to reach zero.
%C The iterations always fall to zero, proof by induction: 0 is 0; 1 -> 0; 2 -> 1; 3 -> 2; 4 -> 2; n -> some number less than n.
%C First occurrence of k >= 0: 0, 1, 2, 3, 10, 11, 26, 83, 178, ... see A324921.
%F a(n) = 1 iff n is a perfect square (A000290).
%e a(0) = 0;
%e a(1) = 1 since 1 -> 0;
%e a(2) = 2 since 2 -> 1 -> 0;
%e a(3) = 3 since 3 -> 2 -> 1 -> 0;
%e a(4) = 1 since 4 -> 0; etc.
%t g[n_] := Block[{d = Divisors@n}, len = Length@d; If[ OddQ@ len, 0, d[[1 + len/2]] - d[[len/2]]]]; f[n_] := Length@ NestWhileList[f, n, # > 0 &] -1; Array[f, 105, 0]
%o (PARI) a056737(n)=n=divisors(n); n[(2+#n)\2]-n[(1+#n)\2] \\ after _M. F. Hasler_ in A056737
%o a(n) = my(x=n, i=0); while(x!=0, i++; x=a056737(x)); i \\ _Felix Fröhlich_, Mar 20 2019
%Y Cf. A056737, A139693, A324921.
%K nonn
%O 0,3
%A _Robert G. Wilson v_, Mar 20 2019
|