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.

A333176 a(n) = Sum_{k=1..n} (binomial(n,k) mod 2) * prime(k).

Original entry on oeis.org

2, 3, 10, 7, 20, 23, 58, 19, 44, 51, 112, 63, 140, 151, 328, 53, 114, 117, 250, 131, 276, 287, 604, 161, 342, 355, 742, 383, 798, 825, 1720, 131, 270, 273, 566, 289, 596, 607, 1252, 323, 664, 675, 1392, 711, 1458, 1481, 3046, 407, 832, 839, 1718, 875, 1782
Offset: 1

Views

Author

Ilya Gutkovskiy, Mar 10 2020

Keywords

Crossrefs

Programs

  • Maple
    N:= 200: # for a(1) .. a(N)
    P:= [seq(ithprime(i),i=1..N)]:
    B:= [1,1]: R:= 2:
    for n from 2 to N do
      B:= [1,op(B[2..-1]+B[1..-2] mod 2),1];
      R:= R, convert(P[select(t -> B[t+1] = 1,[$1..n])],`+`);
    od:
    R; # Robert Israel, Jan 29 2025
  • Mathematica
    Table[Sum[Mod[Binomial[n, k], 2] Prime[k], {k, 1, n}], {n, 1, 53}]
  • PARI
    a(n) = sum(k=1, n, if (binomial(n, k) % 2, prime(k))); \\ Michel Marcus, Mar 10 2020
    
  • Python
    from sympy import prime
    def A333176(n): return sum(prime(k) for k in range(1,n+1) if not ~n&k) # Chai Wah Wu, Jul 22 2025

Formula

Sum_{k=1..n} (-1)^A010060(n-k) * (binomial(n,k) mod 2) * a(k) = prime(n).