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.

A350880 a(n) is the constant term in expansion of Product_{k=1..n} (x^prime(k) + 1 + 1/x^prime(k)).

Original entry on oeis.org

1, 1, 1, 3, 5, 7, 17, 39, 95, 233, 561, 1435, 3643, 9417, 24973, 66695, 177915, 475629, 1293017, 3517223, 9636365, 26676197, 73848517, 205382439, 571628347, 1588203787, 4435819313, 12474619295, 35194448271, 99782519701, 283514955585, 799783925547
Offset: 0

Views

Author

Ilya Gutkovskiy, Jan 20 2022

Keywords

Comments

a(n) is the number of solutions to 0 = Sum_{i=1..n} c_i * prime(i) with c_i in {-1,0,1}. a(3) = 3: -2-3+5, +2+3-5, 0+0+0. - Alois P. Heinz, Dec 28 2023

Crossrefs

Programs

  • Maple
    s:= proc(n) s(n):= `if`(n<1, 0, ithprime(n)+s(n-1)) end:
    b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=0, 1,
          b(n, i-1)+b(n+ithprime(i), i-1)+b(abs(n-ithprime(i)), i-1)))
        end:
    a:= n-> b(0, n):
    seq(a(n), n=0..40);  # Alois P. Heinz, Dec 28 2023
  • Mathematica
    s[n_] := s[n] = If[n < 1, 0, Prime[n] + s[n-1]];
    b[n_, i_] := b[n, i] = If[n > s[i], 0, If[i == 0, 1, b[n, i-1] + b[n + Prime[i], i-1] + b[Abs[n - Prime[i]], i-1]]];
    a[n_] := b[0, n];
    Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Apr 27 2025, after Alois P. Heinz *)
  • PARI
    a(n) = polcoef (prod(k=1, n, x^prime(k) + 1 + 1/x^prime(k)), 0); \\ Michel Marcus, Jan 21 2022