login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A049865 Number of iterations of unitary totient function (A047994) required to reach 1 from n. 7

%I #20 Dec 21 2021 23:42:37

%S 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 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 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 Number of iterations of unitary totient function (A047994) required to reach 1 from n.

%C a(A003271(n)) = n and a(m) <> n for m < A003271(n). [_Reinhard Zumkeller_, Aug 17 2011]

%H T. D. Noe, <a href="/A049865/b049865.txt">Table of n, a(n) for n = 1..10000</a>

%p A049865 := proc(n)

%p if n = 1 then

%p 0 ;

%p else

%p 1+procname( A047994(n)) ;

%p end if;

%p end proc: # _R. J. Mathar_, May 02 2013

%t 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 (Haskell)

%o a049865 n = length $ takeWhile (> 1) $ iterate a047994 n

%o a049865_list = map a049865 [1..]

%o -- _Reinhard Zumkeller_, Aug 17 2011

%K nonn,easy,nice

%O 1,3

%A _David W. Wilson_

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified March 28 18:04 EDT 2024. Contains 371254 sequences. (Running on oeis4.)