login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

a(n) = psi(n) - phi(n).
4

%I #26 Dec 05 2023 08:11:48

%S 0,2,2,4,2,10,2,8,6,14,2,20,2,18,16,16,2,30,2,28,20,26,2,40,10,30,18,

%T 36,2,64,2,32,28,38,24,60,2,42,32,56,2,84,2,52,48,50,2,80,14,70,40,60,

%U 2,90,32,72,44,62,2,128,2,66,60,64,36,124,2,76,52,120,2,120,2,78,80,84,36,144

%N a(n) = psi(n) - phi(n).

%C Even numbers that are not the terms of this sequence are 12, 102, 114, 130, ...

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

%F a(n) = A001615(n) - A000010(n).

%F a(n) = 2 iff n is prime.

%F a(n) = 2*A069359(n) iff n is in A070915.

%F Sum_{k=1..n} a(k) = c * n^2 + O(n*log(n)), where c = 9/(2*Pi^2) = 0.455945... (A088245). - _Amiram Eldar_, Dec 05 2023

%t psi[n_] := If[n < 1, 0, n Sum[ MoebiusMu[d]^2/d, {d, Divisors@ n}]]; Array[psi@# - EulerPhi@# &, 87] (* _Robert G. Wilson v_, Sep 23 2017 *)

%o (PARI) a001615(n) = my(f=factor(n)); prod(i=1, #f~, f[i, 1]^f[i, 2] + f[i, 1]^(f[i, 2]-1));

%o a(n) = a001615(n) - eulerphi(n); \\ after _Charles R Greathouse IV_ at A001615

%Y Cf. A000010, A001615, A051612, A069359, A070915, A088245, A291784.

%K nonn,easy,look

%O 1,2

%A _Altug Alkan_, Sep 23 2017