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

A346621
a(n) = Sum_{ x <= n : omega(x) = 2 } x.
2
0, 0, 0, 0, 0, 6, 6, 6, 6, 16, 16, 28, 28, 42, 57, 57, 57, 75, 75, 95, 116, 138, 138, 162, 162, 188, 188, 216, 216, 216, 216, 216, 249, 283, 318, 354, 354, 392, 431, 471, 471, 471, 471, 515, 560, 606, 606, 654, 654, 704, 755, 807, 807, 861, 916, 972, 1029, 1087, 1087, 1087
OFFSET
1,6
LINKS
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