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

A378764
Sum of the semiprimes which are less than or equal to n minus the sum of the primes which are less than or equal to n.
0
0, -2, -5, -1, -6, 0, -7, -7, 2, 12, 1, 1, -12, 2, 17, 17, 0, 0, -19, -19, 2, 24, 1, 1, 26, 52, 52, 52, 23, 23, -8, -8, 25, 59, 94, 94, 57, 95, 134, 134, 93, 93, 50, 50, 50, 96, 49, 49, 98, 98, 149, 149, 96, 96, 151, 151, 208, 266, 207, 207, 146, 208, 208, 208, 273, 273, 206, 206, 275, 275
OFFSET
1,2
COMMENTS
After a(32), a(n) always exceeds 0. See A243906(32).
EXAMPLE
a(6) = 0, because (4+6) - (2+3+5) = 0.
MATHEMATICA
a[n_] := Plus @@ Select[ Range@ n, PrimeOmega@ # == 2 &] - Plus @@ Select[ Range@ n, PrimeOmega@ # == 1 &]; Array[a, 70]
PROG
(PARI) a(n) = my(vf=apply(factor, [1..n])); vecsum(Vec(select(x->(bigomega(x)==2), vf, 1))) - vecsum(Vec(select(x->(bigomega(x)==1), vf, 1))); \\ Michel Marcus, Dec 28 2024
CROSSREFS
KEYWORD
sign,new
AUTHOR
Robert G. Wilson v and Luca Bencini-Tibo, Dec 20 2024
STATUS
approved