Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #19 Dec 04 2023 01:39:06
%S 0,1,1,1,1,2,1,1,2,4,1,0,1,6,5,1,1,3,1,2,7,10,1,-4,4,12,5,4,1,2,1,1,
%T 11,16,9,-7,1,18,13,-2,1,6,1,8,9,22,1,-12,6,17,17,10,1,6,13,0,19,28,1,
%U -20,1,30,13,1,15,14,1,14,23,18,1,-27,1,36,21,16,15,18,1,-10,14,40,1,-20,19,42,29,4,1,-12,17,20,31,46,21,-28,1,39,21,3,1,26
%N a(n) = 3*n - 2*phi(n) - sigma(n); Difference between the deficiency of n and its Moebius-transform.
%H Antti Karttunen, <a href="/A297159/b297159.txt">Table of n, a(n) for n = 1..65537</a>
%F a(n) = A033879(n) - A083254(n) = 3*n - 2*A000010(n) - A000203(n).
%F a(n) = -Sum_{d|n, d<n} A008683(n/d)*A033879(d).
%F Sum_{k=1..n} a(k) = (3/2 - 6/Pi^2 - Pi^2/12) * n^2 + O(n*log(n)). - _Amiram Eldar_, Dec 04 2023
%t a[n_] := 3*n - 2*EulerPhi[n] - DivisorSigma[1, n]; Array[a, 100] (* _Amiram Eldar_, Dec 04 2023 *)
%o (PARI) A297159(n) = (3*n - 2*eulerphi(n) - sigma(n));
%o (PARI) A297159(n) = -sumdiv(n,d,(d<n)*moebius(n/d)*((2*d)-sigma(d)));
%o (Python)
%o from sympy import totient, divisor_sigma
%o def a(n): return 3*n-2*totient(n)-divisor_sigma(n)
%o print([a(n) for n in range(1, 101)]) # _Indranil Ghosh_, Mar 02 2018
%Y Cf. A000010, A000203, A008683, A033879, A083254.
%Y Cf. also A051709, A296074.
%K sign,easy
%O 1,6
%A _Antti Karttunen_, Mar 02 2018