OFFSET
1,4
COMMENTS
Always >0 for n>0. a(n)=1 if n is prime.
If p is a prime and k is a natural number then a(p^k)=p^(k-1) because a(p^k)=(p^k)^2-sigma(p^k)*phi(p^k) =p^(2k)-(p-1)*p^(k-1)*(p^(k+1)-1)/(p-1)=p^(k-1). If n is a composite number then a(n)>1 and a(1)=0, so n is prime iff a(n)=1. - Farideh Firoozbakht, Nov 15 2005
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
FORMULA
a(n) = n^2-A062354(n). - R. J. Mathar, Oct 01 2011
Sum_{k=1..n} a(k) ~ c * n^3 / 3, where c = 1 - A065465 = 0.118486... . - Amiram Eldar, Dec 04 2023
EXAMPLE
sigma(10) = 18; phi(10) = 4; 10^2 - sigma(10)*phi(10) = 28. sigma(p) = p+1; phi(p) = p-1; p^2 - (p+1)(p-1) = 1. [From Walter Nissen, Aug 29 2009]
MATHEMATICA
Table[n^2-EulerPhi[n]DivisorSigma[1, n], {n, 70}] (* Harvey P. Dale, Oct 22 2016 *)
PROG
(PARI) a(n)=n^2-eulerphi(n)*sigma(n) \\ Charles R Greathouse IV, Nov 27 2013
CROSSREFS
KEYWORD
easy,nonn
AUTHOR
Benoit Cloitre, Apr 13 2002
STATUS
approved