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.

Showing 1-2 of 2 results.

A292698 Number of solutions to 3 +- 7 +- 13 +- 19 +- ... +- prime(4*n) = 0.

Original entry on oeis.org

0, 0, 0, 1, 2, 8, 27, 83, 292, 944, 3279, 11291, 38992, 138066, 490248, 1757360, 6347321, 22998089, 83780199, 306819363, 1128999790, 4174251748, 15507225620, 57767819903, 215327188611, 803901214851, 3013081897103, 11331883386143, 42737620941612
Offset: 1

Views

Author

Seiichi Manyama, Sep 21 2017

Keywords

Examples

			For n = 4 the solution is 3 - 7 - 13 + 19 - 29 + 37 + 43 - 53 = 0.
		

Crossrefs

Programs

  • Maple
    s:= proc(n) s(n):= `if`(n=0, 0, ithprime(2*n)+s(n-1)) end:
    b:= proc(n, i) option remember; `if`(n>s(i), 0, `if`(i=0, 1,
          (p-> b(n+p, i-1)+b(abs(n-p), i-1))(ithprime(2*i))))
        end:
    a:= n-> b(0, 2*n)/2:
    seq(a(n), n=1..30);  # Alois P. Heinz, Sep 21 2017
  • Mathematica
    s[n_] := s[n] = If[n == 0, 0, Prime[2n] + s[n-1]];
    b[n_, i_] := b[n, i] = If[n > s[i], 0, If[i == 0, 1,
         With[{p = Prime[2i]}, b[n+p, i-1] + b[Abs[n-p], i-1]]]];
    a[n_] := b[0, 2n]/2;
    Table[a[n], {n, 1, 30}] (* Jean-François Alcover, Apr 30 2022, after Alois P. Heinz *)
  • PARI
    {a(n) = 1/2*polcoeff(prod(k=1, 2*n, x^prime(2*k)+1/x^prime(2*k)), 0)}

Formula

Constant term in the expansion of 1/2 * Product_{k=1..2*n} (x^prime(2*k) + 1/x^prime(2*k)).

A292700 1/4 of the number of paths that are made of alternate vertical and horizontal 4*n consecutive prime (> 2 and < prime(4*n+2)) steps. (Each path begins and ends at the same point but is allowed to intersect itself.)

Original entry on oeis.org

0, 0, 0, 2, 4, 40, 756, 8466, 70664, 788240, 11086299, 114208465, 1536869680, 19129734630, 228346732944, 3059857239120, 38601632542723, 509554928113867, 6793745301391293, 92409631618813044, 1240139159309482820, 16995549322569645324, 236256012348427662180
Offset: 1

Views

Author

Seiichi Manyama, Sep 21 2017

Keywords

Examples

			U, D, L and R express up, down, left and right.
n = 4:
3R, 5U, 7L, 11D, 13L, 17U, 19R, 23U, 29L, 31U, 37R, 41U, 43R, 47D, 53L, 59D.
3R, 5U, 7L, 11U, 13L, 17D, 19R, 23U, 29L, 31U, 37R, 41D, 43R, 47U, 53L, 59D.
		

Crossrefs

Formula

Constant term in the expansion of (1/4) * Product_{k=1..2*n} (x^prime(2*k) + 1/x^prime(2*k)) * Product_{k=1..2*n} (y^prime(2*k+1) + 1/y^prime(2*k+1)).
a(n) = A292698(n) * A292699(n).
Showing 1-2 of 2 results.