A049865 Number of iterations of unitary totient function (A047994) required to reach 1 from n.
0, 1, 2, 3, 4, 2, 3, 4, 5, 4, 5, 3, 4, 3, 5, 6, 7, 5, 6, 4, 4, 5, 6, 4, 5, 4, 5, 6, 7, 5, 6, 7, 5, 7, 5, 5, 6, 6, 5, 7, 8, 4, 5, 6, 8, 6, 7, 6, 7, 5, 8, 6, 7, 5, 8, 5, 6, 7, 8, 5, 6, 6, 7, 8, 7, 5, 6, 7, 7, 5, 6, 6, 7, 6, 7, 6, 6, 5, 6, 6, 7, 8, 9, 6, 9, 5, 6, 6, 7, 8, 7, 6, 6, 7, 7, 7, 8, 7, 7, 7, 8, 8, 9, 7, 7, 7, 8, 6, 7, 8, 7
Offset: 1
Links
- T. D. Noe, Table of n, a(n) for n = 1..10000
Programs
-
Haskell
a049865 n = length $ takeWhile (> 1) $ iterate a047994 n a049865_list = map a049865 [1..] -- Reinhard Zumkeller, Aug 17 2011
-
Maple
A049865 := proc(n) if n = 1 then 0 ; else 1+procname( A047994(n)) ; end if; end proc: # R. J. Mathar, May 02 2013
-
Mathematica
uphi[n_] := (f = FactorInteger[n]; Times @@ (f[[All, 1]]^f[[All, 2]] - 1)); uphi[n_ /; n <= 1] = 1; a[n_] := (k = 0; FixedPoint[ (k++; uphi[#]) & , n]; k-1); Table[a[n], {n, 1, 120}] (* Jean-François Alcover, Jan 20 2012 *)
Comments