OFFSET
1,6
LINKS
Alois P. Heinz, Table of n, a(n) for n = 1..20000
MAPLE
a:= proc(n) option remember; `if`(n=0, 0,
a(n-1)+`if`(nops(ifactors(n)[2])=2, n, 0))
end:
seq(a(n), n=1..60); # Alois P. Heinz, Aug 23 2021
PROG
(PARI) a(n) = sum(x=1, n, if (omega(x)==2, x)); \\ Michel Marcus, Aug 23 2021
(Python)
from sympy import primefactors
def A346621(n):
return 0 if n <= 2 else A346621(n-1) + (n if len(primefactors(n)) == 2 else 0) # Chai Wah Wu, Aug 23 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
N. J. A. Sloane, Aug 23 2021
STATUS
approved