cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A378905 a(n) is the number of odd squarefree semiprimes (A046388) < prime(n).

Original entry on oeis.org

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, 17, 20, 21, 22, 22, 25, 25, 26, 28, 28, 28, 29, 29, 32, 32, 32, 32, 36, 41, 41, 41, 41, 43, 43, 45, 46, 47, 49, 49, 49, 49, 49, 51, 56, 57, 57, 57, 62, 63, 65, 65, 65, 66
Offset: 1

Views

Author

Hugo Pfoertner, Dec 22 2024

Keywords

Examples

			a(11) = 2 because 15 and 21 are the 2 terms of A046388 < prime(11) = 31;
a(12) = 4: 2 additional terms 33 and 35 of A046388 are < prime(12) = 37.
		

Crossrefs

Programs

  • Mathematica
    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 *)
  • Python
    from math import isqrt
    from sympy import primepi, prime, primerange
    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