Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #12 Dec 23 2024 01:50:50
%S 0,0,0,0,0,0,1,1,2,2,2,4,5,5,5,6,8,8,9,10,10,11,11,13,16,16,16,16,16,
%T 17,20,21,22,22,25,25,26,28,28,28,29,29,32,32,32,32,36,41,41,41,41,43,
%U 43,45,46,47,49,49,49,49,49,51,56,57,57,57,62,63,65,65,65,66
%N a(n) is the number of odd squarefree semiprimes (A046388) < prime(n).
%H Michael De Vlieger, <a href="/A378905/b378905.txt">Table of n, a(n) for n = 1..10000</a>
%e a(11) = 2 because 15 and 21 are the 2 terms of A046388 < prime(11) = 31;
%e a(12) = 4: 2 additional terms 33 and 35 of A046388 are < prime(12) = 37.
%t nn = 360; c = 0; n = 1; {0}~Join~Reap[Until[n > nn, If[And[SquareFreeQ[n], PrimeNu[n] == 2], c++]; If[PrimeQ[n], Sow[c]]; n += 2] ][[-1, 1]] (* _Michael De Vlieger_, Dec 22 2024 *)
%o (Python)
%o from math import isqrt
%o from sympy import primepi, prime, primerange
%o def A378905(n): return 0 if n<3 else int(1-((t:=primepi(s:=isqrt(p:=prime(n))))*(t+1)>>1)+sum(primepi(p//k) for k in primerange(3, s+1))) # _Chai Wah Wu_, Dec 22 2024
%Y Cf. A000720, A046388, A292785.
%K nonn
%O 1,9
%A _Hugo Pfoertner_, Dec 22 2024