This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A049865 #20 Dec 21 2021 23:42:37 %S A049865 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, %T A049865 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, %U A049865 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 %N A049865 Number of iterations of unitary totient function (A047994) required to reach 1 from n. %C A049865 a(A003271(n)) = n and a(m) <> n for m < A003271(n). [_Reinhard Zumkeller_, Aug 17 2011] %H A049865 T. D. Noe, <a href="/A049865/b049865.txt">Table of n, a(n) for n = 1..10000</a> %p A049865 A049865 := proc(n) %p A049865 if n = 1 then %p A049865 0 ; %p A049865 else %p A049865 1+procname( A047994(n)) ; %p A049865 end if; %p A049865 end proc: # _R. J. Mathar_, May 02 2013 %t A049865 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 *) %o A049865 (Haskell) %o A049865 a049865 n = length $ takeWhile (> 1) $ iterate a047994 n %o A049865 a049865_list = map a049865 [1..] %o A049865 -- _Reinhard Zumkeller_, Aug 17 2011 %K A049865 nonn,easy,nice %O A049865 1,3 %A A049865 _David W. Wilson_