OFFSET
1,6
COMMENTS
Sigma is the sum of divisors (A000203), and phi is the Euler totient function (A000010). - Michael B. Porter, Jul 05 2013
Because sigma and phi are multiplicative functions, it is easy to show that (1) if a(n)=0, then n is prime or 1 and (2) if a(n)=2, then n is the product of two distinct prime numbers. Note that a(n) is the n-th term of the Dirichlet series whose generating function is given below. Using the generating function, it is theoretically possible to compute a(n). Hence a(n)=0 could be used as a primality test and a(n)=2 could be used as a test for membership in P2 (A006881). - T. D. Noe, Aug 01 2002
It appears that a(n) - A002033(n) = zeta(s-1) * (zeta(s) - 2 + 1/zeta(s)) + 1/(zeta(s)-2). - Eric Desbiaux, Jul 04 2013
a(n) = 1 if and only if n = prime(k)^2 (n is in A001248). It seems that a(n) = k has only finitely many solutions for k >= 3. - Jianing Song, Jun 27 2021
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..65537 (First 1000 terms from T. D. Noe.)
Carlos Rivera, Puzzle 76. z(n)=sigma(n) + phi(n) - 2n, The Prime Puzzles and Problems Connection.
FORMULA
Dirichlet g.f.: zeta(s-1) * (zeta(s) - 2 + 1/zeta(s)). - T. D. Noe, Aug 01 2002
From Antti Karttunen, Mar 02 2018: (Start)
a(n) = A001065(n) - A051953(n). [Difference between the sum of proper divisors of n and their Moebius-transform.]
Sum_{k=1..n} a(k) = (3/(Pi^2) + Pi^2/12 - 1) * n^2 + O(n*log(n)). - Amiram Eldar, Dec 03 2023
EXAMPLE
a(5) = sigma(5) + phi(5) - 2*5 = 6 + 4 - 10 = 0.
MATHEMATICA
Table[DivisorSigma[1, n]+EulerPhi[n]-2n, {n, 80}] (* Harvey P. Dale, Apr 08 2015 *)
PROG
(PARI) a(n)=sigma(n)+eulerphi(n)-2*n \\ Charles R Greathouse IV, Jul 05 2013
(PARI) A051709(n) = -sumdiv(n, d, (d<n)*moebius(n/d)*(sigma(d)-d)); \\ Antti Karttunen, Mar 02 2018
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved