OFFSET
1,2
COMMENTS
a(p) = 1 for prime p > 2. Since phi(p) = p - 1 and sigma(p) = p + 1, the largest prime q < p - 1 must be the prime previous to p, while p itself is the largest prime less than p + 1 for p > 2. - Michael De Vlieger, Jan 22 2020
LINKS
Michael De Vlieger, Table of n, a(n) for n = 1..10000
FORMULA
EXAMPLE
n=12: sigma(12)=28, phi(n)=4, Pi(28)-Pi(4)=9-2=7.
MATHEMATICA
Array[Subtract @@ PrimePi@{DivisorSigma[1, #], EulerPhi@ #} &, 86] (* Michael De Vlieger, Jan 22 2020 *)
PROG
(PARI) a(n) = primepi(sigma(n)) - primepi(eulerphi(n)); \\ Michel Marcus, Aug 29 2019
CROSSREFS
KEYWORD
nonn
AUTHOR
Labos Elemer, Jul 10 2003
STATUS
approved