login

Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.

a(n) = Sum_{ x <= n : x odd and omega(x) = 2 } x.
3

%I #17 Feb 13 2023 05:16:57

%S 0,0,0,0,0,0,0,0,0,0,0,0,0,0,15,15,15,15,15,15,36,36,36,36,36,36,36,

%T 36,36,36,36,36,69,69,104,104,104,104,143,143,143,143,143,143,188,188,

%U 188,188,188,188,239,239,239,239,294,294,351,351,351,351,351,351,414,414,479,479,479,479

%N a(n) = Sum_{ x <= n : x odd and omega(x) = 2 } x.

%H Alois P. Heinz, <a href="/A346623/b346623.txt">Table of n, a(n) for n = 1..20000</a>

%p a:= proc(n) option remember; `if`(n=0, 0, a(n-1)+

%p `if`(n::odd and nops(ifactors(n)[2])=2, n, 0))

%p end:

%p seq(a(n), n=1..68); # _Alois P. Heinz_, Aug 23 2021

%t a[n_] := a[n] = If[n == 1, 0, a[n-1] + If[OddQ[n] && PrimeNu[n] == 2, n, 0]];

%t Table[a[n], {n, 1, 100}] (* _Jean-François Alcover_, Feb 13 2023 *)

%o (Python)

%o from sympy import primefactors

%o def A346623(n):

%o return 0 if n <= 2 else A346623(n-1) + (n if n % 2 and len(primefactors(n)) == 2 else 0) # _Chai Wah Wu_, Aug 23 2021

%Y Cf. A001221, A007774, A346221, A346222.

%K nonn

%O 1,15

%A _N. J. A. Sloane_, Aug 23 2021