OFFSET
1,7
LINKS
G. C. Greubel, Table of n, a(n) for n = 1..5000
FORMULA
G.f.: A(x) = B(x) + C(x) - D(x), where B(x) = Sum_{k>=1} x^(2*k+1)/((1 - x^k)*(1 - x^(k+1))), C(x) = Sum_{k>=1} x^prime(k)/(1 - x^prime(k)), D(x) = Sum_{k>=1} x^prime(k)/(1 - x).
EXAMPLE
a(10) = 4 because 10 has 4 divisors {1,2,5,10} therefore 6 non-divisors {3,4,6,7,8,9} out of which 4 are nonprimes {4,6,8,9}.
MATHEMATICA
Table[n - PrimePi[n] - DivisorSigma[0, n] + PrimeNu[n], {n, 1, 100}]
PROG
(PARI) for(n=1, 50, print1(n - primepi(n) - numdiv(n) + omega(n), ", ")) \\ G. C. Greubel, May 22 2017
(PARI) first(n)=my(v=vector(n), pp); forfactored(k=1, n, if(k[2][, 2]==[1]~, pp++); v[k[1]]=k[1] - pp - numdiv(k) + omega(k)); v \\ Charles R Greathouse IV, May 23 2017
(Python)
from sympy import primepi, divisor_count, primefactors
def a(n): return 0 if n==1 else n - primepi(n) - divisor_count(n) + len(primefactors(n)) # Indranil Ghosh, May 23 2017
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 12 2016
STATUS
approved