login
Number of odd squarefree semiprimes < 10^n.
3

%I #22 Oct 17 2024 15:47:19

%S 0,16,194,1932,18181,168330,1555366,14424896,134429269,1258812629,

%T 11840308472,111817802539,1059796159358,10076977878935,96091981692305,

%U 918679869869451,8803388128870716,84537081067757934,813340036390023775,7838825925395981969,75669246174605279757

%N Number of odd squarefree semiprimes < 10^n.

%F a(n) = A066265(n) - A122121(n) - A220262(n) + 1 for n > 1.

%e a(2)=16 because there are 16 squarefree odd semiprimes < 10^2: 15=3*5, 21=3*7, 33=3*11, 35=5*7, 39=3*13, 51=3*17, 55=5*11, 57=3*19, 65=5*13, 69=3*23, 77=7*11, 85=5*17, 87=3*29, 91=7*13, 93=3*31, 95=5*19.

%t -1 + Accumulate@ Table[Count[Range[10^n + 1, 10^(n + 1) - 1, 2], _?(And[ SquareFreeQ@ #, PrimeNu[#] == 2] &)], {n, 0, 5}] (* _Michael De Vlieger_, Oct 10 2017 *)

%o (Python)

%o from math import isqrt

%o from sympy import primepi, primerange

%o def A292785(n): return int((-(t:=primepi(s:=isqrt(m:=10**n)))*(t+1)>>1)+1+sum(primepi(m//k) for k in primerange(3, s+1))) if n>1 else 0 # _Chai Wah Wu_, Oct 17 2024

%Y Cf. A046388, A066265, A122121, A220262.

%K nonn

%O 1,2

%A _Hugo Pfoertner_, Oct 10 2017

%E a(21) from _Jinyuan Wang_, Jul 30 2021