OFFSET
0,3
FORMULA
EXAMPLE
MATHEMATICA
OddSemiPrimePi[n_] := Sum[ PrimePi[n/Prime@i] - i + 1, {i, 2, PrimePi@ Sqrt@ n}]; Table[ OddSemiPrimePi[10^n], {n, 14}] (* Robert G. Wilson v, Feb 02 2006 *)
PROG
(Python)
from math import isqrt
from sympy import primepi, primerange
def A085770(n): return int((-(t:=primepi(s:=isqrt(m:=10**n)))*(t-1)>>1)+sum(primepi(m//k) for k in primerange(3, s+1))) if n>1 else n # Chai Wah Wu, Oct 17 2024
CROSSREFS
KEYWORD
nonn,changed
AUTHOR
Hugo Pfoertner, Jul 22 2003
EXTENSIONS
a(10)-a(14) from Robert G. Wilson v, Feb 02 2006
a(15)-a(16) from Donovan Johnson, Mar 18 2010
a(0) inserted by and a(17)-a(21) from Jinyuan Wang, Jul 30 2021
STATUS
approved