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.

A082454 a(n) = prime(n) + prime(n-1) - a(n-1) with a(0) = a(1) = 0.

Original entry on oeis.org

0, 0, 5, 3, 9, 9, 15, 15, 21, 21, 31, 29, 39, 39, 45, 45, 55, 57, 63, 65, 73, 71, 81, 81, 91, 95, 103, 101, 109, 107, 115, 125, 133, 135, 141, 147, 153, 155, 165, 165, 175, 177, 183, 189, 195, 195, 201, 209, 225, 225, 231, 231, 241, 239, 253, 255, 265, 267, 273, 275
Offset: 0

Views

Author

Labos Elemer, Apr 25 2003

Keywords

Comments

In fact only one initial value is needed.
If initial values were {a(0)=0, a(1)=1} then we would get A014687.
prime(10) + prime(11) = 29 + 31 = a(10) + a(11) = 31 + 29 (order was reversed!).
If initial values were {a(0)=1, a(1)=2} then (after a(0)=1) we would get A000040, the primes, and would have prime(10) + prime(11) = 29 + 31 = a(10) + a(11) = 29 + 31 (identity).
Initial values {a(0)=1, a(1)=3} would give A014686.

Crossrefs

Programs

  • Mathematica
    g[x_] := Prime[x]+Prime[x-1]-g[x-1] g[0]=0; g[1]=0; Table[g[w], {w, 0, 100}]
    Prepend[Table[Prime[n] + 2 (-1)^n, {n, 59}],0] (* George Beck, Jun 03 2022 *)
  • PARI
    lista(nn) = {print1(a=0, ", "); print1(a, ", "); for (n=2, nn, a = prime(n) + prime(n-1) - a; print1(a, ", "););} \\ Michel Marcus, Apr 06 2015

Formula

a(n) = prime(n) + 2*(-1)^n. - George Beck, Jun 03 2022

Extensions

Name corrected by George Beck, Jun 03 2022

A082456 a(n) = prime(n) + prime(n-1) - a(n-1), with a(0)=0, a(1)=127, and prime(i) is the i-th prime.

Original entry on oeis.org

0, 127, -122, 130, -118, 136, -112, 142, -106, 148, -96, 156, -88, 166, -82, 172, -72, 184, -64, 192, -54, 198, -46, 208, -36, 222, -24, 228, -18, 234, -12, 252, 6, 262, 14, 274, 26, 282, 38, 292, 48, 304, 56, 316, 68, 322, 74, 336, 98, 352, 104, 358, 114, 366, 126, 382, 138, 394, 146, 402, 156, 408, 168, 432, 186, 438
Offset: 0

Views

Author

Labos Elemer, Apr 25 2003

Keywords

Comments

Initial values {0, 1} give A014687.
Initial values {1, 2} give A000040.
Initial values {1, 3} give A014686.

Crossrefs

Programs

  • Mathematica
    g[x_] := Prime[x]+Prime[x-1]-g[x-1] g[0]=0; g[1]=127; Table[g[w], {w, 0, 100}]
  • PARI
    a(n) = if (n==0, 0, if (n==1, 127, prime(n) + prime(n-1) - a(n-1))); \\ Michel Marcus, Mar 08 2022

Extensions

Entry revised by N. J. A. Sloane, Dec 22 2005
Showing 1-2 of 2 results.