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.

A152720 A prime-based vector recursion: a(n)={Prime[n],Prime[n-1],-Prime[n-2],...,-1,-1}.

Original entry on oeis.org

-1, 1, -1, 3, -1, -1, 5, -3, -1, -1, 7, -5, -3, -1, -1, 11, -7, -5, -3, -1, -1, 13, -11, -7, -5, -3, -1, -1, 17, -13, -11, -7, -5, -3, -1, -1, 19, -17, -13, -11, -7, -5, -3, -1, -1, 23, -19, -17, -13, -11, -7, -5, -3, -1, -1, 29, -23, -19, -17, -13, -11, -7, -5, -3, -1, -1
Offset: 0

Views

Author

Roger L. Bagula, Dec 11 2008

Keywords

Comments

Row sums are: {-1, 0, 1, 0, -3, -6, -15, -24, -39, -54, -71,...}

Examples

			{-1},
{1, -1},
{3, -1, -1},
{5, -3, -1, -1},
{7, -5, -3, -1, -1},
{11, -7, -5, -3, -1, -1},
{13, -11, -7, -5, -3, -1, -1},
{17, -13, -11, -7, -5, -3, -1, -1},
{19, -17, -13, -11, -7, -5, -3, -1, -1},
{23, -19, -17, -13, -11, -7, -5, -3, -1, -1},
{29, -23, -19, -17, -13, -11, -7, -5, -3, -1, -1}
		

Crossrefs

Programs

  • Mathematica
    b[0] = {-1}; b[1] = {1, -1};
    b[n_] := b[n] = Join[{Prime[n ]}, {-b[n - 1][[ 1]]}, Table[b[n - 1][[i]], {i, 2, Length[b[n - 1]]}]];
    Table[b[n], {n, 0, 10}]; Flatten[%]

Formula

a(n)={Prime[n],Prime[n-1],-Prime[n-2],...,-1,-1}.