cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A346621 a(n) = Sum_{ x <= n : omega(x) = 2 } x.

This page as a plain text file.
%I A346621 #21 Apr 24 2025 06:15:28
%S A346621 0,0,0,0,0,6,6,6,6,16,16,28,28,42,57,57,57,75,75,95,116,138,138,162,
%T A346621 162,188,188,216,216,216,216,216,249,283,318,354,354,392,431,471,471,
%U A346621 471,471,515,560,606,606,654,654,704,755,807,807,861,916,972,1029,1087,1087,1087
%N A346621 a(n) = Sum_{ x <= n : omega(x) = 2 } x.
%H A346621 Alois P. Heinz, <a href="/A346621/b346621.txt">Table of n, a(n) for n = 1..20000</a>
%p A346621 a:= proc(n) option remember; `if`(n=0, 0,
%p A346621       a(n-1)+`if`(nops(ifactors(n)[2])=2, n, 0))
%p A346621     end:
%p A346621 seq(a(n), n=1..60);  # _Alois P. Heinz_, Aug 23 2021
%t A346621 a[n_] := a[n] = If[n <= 2, 0, a[n-1] + If[PrimeNu[n] == 2, n, 0]];
%t A346621 Table[a[n], {n, 1, 60}] (* _Jean-François Alcover_, Apr 24 2025 *)
%o A346621 (PARI) a(n) = sum(x=1, n, if (omega(x)==2, x)); \\ _Michel Marcus_, Aug 23 2021
%o A346621 (Python)
%o A346621 from sympy import primefactors
%o A346621 def A346621(n):
%o A346621     return 0 if n <= 2 else A346621(n-1) + (n if len(primefactors(n)) == 2 else 0) # _Chai Wah Wu_, Aug 23 2021
%Y A346621 Cf. A001221, A007774, A082997, A346622, A346623.
%K A346621 nonn
%O A346621 1,6
%A A346621 _N. J. A. Sloane_, Aug 23 2021