login

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”).

A337877
Numbers of the form p^2*q where p and q are primes and p <= q.
2
8, 12, 20, 27, 28, 44, 45, 52, 63, 68, 76, 92, 99, 116, 117, 124, 125, 148, 153, 164, 171, 172, 175, 188, 207, 212, 236, 244, 261, 268, 275, 279, 284, 292, 316, 325, 332, 333, 343, 356, 369, 387, 388, 404, 412, 423, 425, 428, 436, 452, 475, 477, 508, 524, 531, 539, 548, 549, 556, 575, 596, 603
OFFSET
1,1
LINKS
EXAMPLE
a(3) = 20 is a term because 20=2^2*5 with 2 <= 5.
MAPLE
N:= 3000: # for terms <= N
P:= select(isprime, [2, seq(i, i=3..N/2, 2)]): nP:= nops(P):
R:= NULL:
for i from 1 to nP do
p2:= P[i]^2;
for j from i to nP do
x:= p2*P[j];
if x > N then break fi;
R:= R, x
od od:
sort([R]);
PROG
(Python)
from sympy import primepi, primerange, integer_nthroot
def A337877(n):
def f(x): return int(n+x-sum(primepi(x//k**2)-a for a, k in enumerate(primerange(integer_nthroot(x, 3)[0]+1))))
def bisection(f, kmin=0, kmax=1):
while f(kmax) > kmax: kmax <<= 1
while kmax-kmin > 1:
kmid = kmax+kmin>>1
if f(kmid) <= kmid:
kmax = kmid
else:
kmin = kmid
return kmax
return bisection(f) # Chai Wah Wu, Aug 29 2024
CROSSREFS
Contained in A337806.
Sequence in context: A232867 A358574 A084488 * A211410 A001749 A175786
KEYWORD
nonn
AUTHOR
Robert Israel, Sep 27 2020
STATUS
approved