login
A247977
If n = 1 or prime, then a(n) = 0; otherwise, if n is a preprime of k-th kind, then a(n) = k.
1
0, 0, 0, 1, 0, 1, 0, 1, 1, 2, 0, 2, 0, 2, 1, 2, 0, 2, 0, 2, 1, 2, 0, 2, 1, 3, 2, 3, 0, 3, 0, 3, 2, 3, 1, 3, 0, 3, 2, 3, 0, 3, 0, 3, 2, 3, 0, 3, 1, 4, 3, 4, 0, 4, 2, 4, 3, 4, 0, 4, 0, 4, 3, 4, 2, 4, 0, 4, 3, 4, 0, 4, 0, 4, 3, 4, 1, 4, 0, 4, 3, 4, 0, 4, 2, 4, 3, 4, 0, 4, 1, 4, 3, 4, 2, 4, 0, 4, 3, 4, 0, 4, 0, 4, 3, 4, 0, 4, 0, 4, 3, 4, 0, 4, 2, 4, 3, 4, 1, 4, 1, 5, 4, 5, 3
OFFSET
1,10
COMMENTS
Preprimes of k-th kind are defined in comment in A247395.
FORMULA
If n is a composite number, then a(n) = pi(sqrt(n)) - pi(lpf(n)) + 1, where pi(x) is prime counting function (cf. A000720), lpf = least prime factor (A020639).
EXAMPLE
If n = 15, then, by the formula, we have a(15) = 2 - 2 + 1 = 1.
MATHEMATICA
Table[If[n==1 || PrimeQ[n], 0, PrimePi[Sqrt[n]] - PrimePi[FactorInteger[n][[1, 1]]] + 1], {n, 1, 125}] (* Indranil Ghosh, Mar 08 2017 *)
PROG
(PARI) for(n=1, 125, print1(if(n==1 || isprime(n), 0, primepi(sqrt(n)) - primepi(vecmin(factor(n)[, 1])) + 1), ", ")) \\ Indranil Ghosh, Mar 08 2017
KEYWORD
nonn,look
AUTHOR
Vladimir Shevelev, Sep 28 2014
STATUS
approved