login
a(n) = A329697(phi(n)), where A329697 is totally additive with a(2) = 0 and a(p) = 1 + a(p-1) for odd primes.
10

%I #25 Jul 25 2020 10:34:48

%S 0,0,0,0,0,0,1,0,1,0,1,0,1,1,0,0,0,1,2,0,1,1,2,0,1,1,2,1,2,0,2,0,1,0,

%T 1,1,2,2,1,0,1,1,3,1,1,2,3,0,3,1,0,1,2,2,1,1,2,2,3,0,2,2,2,0,1,1,3,0,

%U 2,1,3,1,2,2,1,2,2,1,3,0,3,1,2,1,0,3,2,1,2,1,2,2,2,3,2,0,1,3,2,1,2,0,2,1,1

%N a(n) = A329697(phi(n)), where A329697 is totally additive with a(2) = 0 and a(p) = 1 + a(p-1) for odd primes.

%H Antti Karttunen, <a href="/A336469/b336469.txt">Table of n, a(n) for n = 1..65537</a>

%F Additive with a(2^e) = 0, and for odd primes p, a(p^e) = A329697((p - 1)*p^(e-1)) = e*A329697(p) - 1.

%F a(n) = A329697(n) - A005087(n) = A336396(n) + A046660(A000265(n)).

%t Array[Length@ NestWhileList[# - #/FactorInteger[#][[-1, 1]] &, EulerPhi[#], # != 2^IntegerExponent[#, 2] &] - 1 &, 105] (* _Michael De Vlieger_, Jul 24 2020 *)

%o (PARI)

%o A329697(n) = if(!bitand(n,n-1),0,1+A329697(n-(n/vecmax(factor(n)[, 1]))));

%o A336469(n) = A329697(eulerphi(n));

%o \\ Or alternatively as:

%o A336469(n) = { my(f = factor(n)); sum(k=1, #f~, if(2==f[k,1],0,-1 + (f[k, 2]*A329697(f[k, 1])))); };

%Y Cf. A000010, A000265, A003434, A005087, A046660, A064097, A064415, A329697, A336396, A336477.

%Y Cf. A003401 (positions of zeros).

%K nonn

%O 1,19

%A _Antti Karttunen_, Jul 22 2020