Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #14 Aug 11 2019 03:21:37
%S 0,1,2,2,3,3,4,4,5,5,6,6,7,7,8,7,8,8,9,9,10,10,11,10,12,11,13,12,13,
%T 12,13,13,14,14,15,13,14,14,15,14,15,15,16,16,17,17,18,17,19,18,20,19,
%U 20,19,21,20,22,21,22,21,22,22,23,22,24,23,24,24,25,24,25,25,26,26,27,27
%N a(n) is the number of iterations of f(n) = n-phi(tau(n)) needed to reach 1.
%C tau(n) is the number of divisors of n (A000005) and phi(n) is the Euler totient function (A000010).
%D M. Abramowitz and I. A. Stegun, eds., Handbook of Mathematical Functions, National Bureau of Standards Applied Math. Series 55, 1964 (and various reprintings), p. 840.
%H Amiram Eldar, <a href="/A176841/b176841.txt">Table of n, a(n) for n = 1..10000</a>
%e for n = 13, the number 7 is in the sequence because :
%e f(13) = 13 - phi(tau(13)) = 13 - phi(2) = 13 - 1 = 12;
%e f(12) = 12 - phi(tau(12)) = 12 - phi(6) = 12 - 2 = 10;
%e f(10) = 10 - phi(tau(10)) = 10 - phi(4) = 10 - 2 = 8;
%e f(8) = 8- phi(tau(8)) = 8 - phi(4) = 8 - 2 = 6 ;
%e f(6) = 6- phi(tau(6)) = 6 - phi(4) = 6 - 2 = 4 ;
%e f(4) = 4- phi(tau(4)) = 4 - phi(3) = 4 - 2 = 2 ;
%e f(2) = 2- phi(tau(2)) = 2 - phi(2) = 2 - 1 = 1, and a(13) = 7.
%p with(numtheory): n0:=200:tabl:=array(1..n0): for n from 1 to 1000 do:k:=0:nn:=n:for q from 0 to 1000 while(nn<>1) do:nn:=nn - phi(tau((nn))):k:=k+1:od:tabl[n]:=k:od:print(tabl):
%t f[n_] := (k++; n - EulerPhi[ DivisorSigma[0, n]]); f[0] = 0; a[n_] := (k=0; FixedPoint[f, n]; k-1); Table[a[n], {n, 1, 76}](* _Jean-François Alcover_, May 10 2012 *)
%Y Cf. A000005, A000010.
%K nonn
%O 1,3
%A _Michel Lagneau_, Apr 27 2010