OFFSET
1,1
MATHEMATICA
SemiPrimePi[n_] := Sum[ PrimePi[n/Prime@ i] - i + 1, {i, PrimePi@ Sqrt@ n}]; Array[ SemiPrimePi[10^#] &, 14] (* Robert G. Wilson v, Feb 12 2015 *)
PROG
(PARI) a(n)=my(s); forprime(p=2, sqrt(10^n), s+=primepi(10^n\p)); s-binomial(primepi(sqrt(10^n)), 2) \\ Charles R Greathouse IV, Apr 23 2012
(Python)
from math import isqrt
from sympy import primepi, primerange
def A036352(n): return int((-(t:=primepi(s:=isqrt(m:=10**n)))*(t-1)>>1)+sum(primepi(m//k) for k in primerange(1, s+1))) # Chai Wah Wu, Aug 16 2024
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
EXTENSIONS
a(14) from Robert G. Wilson v, May 16 2005
a(15)-a(16) from Donovan Johnson, Mar 18 2010
a(17)-a(18) from A066265, added by Jens Kruse Andersen, Aug 16 2014
a(19)-a(21) from Henri Lifchitz, Jul 04 2015
a(22)-a(23) from Henri Lifchitz, Nov 09 2024
STATUS
approved