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.

Original entry on oeis.org

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

Views

Author

N. J. A. Sloane, Aug 23 2021

Keywords

Crossrefs

Programs

  • 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
  • Mathematica
    a[n_] := a[n] = If[n <= 2, 0, a[n-1] + If[PrimeNu[n] == 2, n, 0]];
    Table[a[n], {n, 1, 60}] (* Jean-François Alcover, Apr 24 2025 *)
  • 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