%I #26 Aug 16 2024 20:47:51
%S 4,34,299,2625,23378,210035,1904324,17427258,160788536,1493776443,
%T 13959990342,131126017178,1237088048653,11715902308080,
%U 111329817298881,1061057292827269,10139482913717352,97123037685177087,932300026230174178,8966605849641219022,86389956293761485464
%N Number of numbers up to 10^n that are products of two primes.
%t SemiPrimePi[n_] := Sum[ PrimePi[n/Prime@ i] - i + 1, {i, PrimePi@ Sqrt@ n}]; Array[ SemiPrimePi[10^#] &, 14] (* _Robert G. Wilson v_, Feb 12 2015 *)
%o (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
%o (Python)
%o from math import isqrt
%o from sympy import primepi, primerange
%o 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
%Y Essentially the same as A066265.
%K nonn
%O 1,1
%A _Shyam Sunder Gupta_
%E a(14) from _Robert G. Wilson v_, May 16 2005
%E a(15)-a(16) from _Donovan Johnson_, Mar 18 2010
%E a(17)-a(18) from A066265, added by _Jens Kruse Andersen_, Aug 16 2014
%E a(19)-a(21) from _Henri Lifchitz_, Jul 04 2015