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.

A001856 A self-generating sequence: every positive integer occurs as a(i)-a(j) for a unique pair i,j.

Original entry on oeis.org

1, 2, 4, 8, 16, 21, 42, 51, 102, 112, 224, 235, 470, 486, 972, 990, 1980, 2002, 4004, 4027, 8054, 8078, 16156, 16181, 32362, 32389, 64778, 64806, 129612, 129641, 259282, 259313, 518626, 518658, 1037316, 1037349, 2074698, 2074734, 4149468
Offset: 1

Views

Author

Keywords

Comments

This is a B_2 sequence. More economical recursion: a(1)=1, a(2n)=2a(2n-1), a(2n+1)=a(2n)+r(n), where r(n) is the smallest positive integer not of the form a(j)-a(i) with 1<=iA247556. - Thomas Ordowski, Sep 28 2014

References

  • R. K. Guy, Unsolved Problems in Number Theory, E25.
  • W. Sierpiński, Elementary Theory of Numbers. Państ. Wydaw. Nauk., Warsaw, 1964, p. 444.
  • N. J. A. Sloane, A Handbook of Integer Sequences, Academic Press, 1973 (includes this sequence).
  • N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).

Crossrefs

Programs

  • Mathematica
    a[1] = 1; a[2] = 2; a[n_?OddQ] := a[n] = 2*a[n-1]; a[n_?EvenQ] := a[n] = a[n-1] + r[(n-2)/2]; r[n_] := ( diff = Table[a[j] - a[i], {i, 1, 2*n+1}, {j, i+1, 2*n+1}] // Flatten // Union; max = diff // Last; notDiff = Complement[Range[max], diff]; If[notDiff == {}, max+1, notDiff // First]); Table[a[n], {n, 1, 39}] (* Jean-François Alcover, Dec 31 2012 *)

Formula

a(1)=1, a(2)=2, a(2n+1) = 2a(2n), a(2n+2) = a(2n+1) + r(n), where r(n) = smallest positive number not of form a(j) - a(i) with 1 <= i < j <= 2n+1.

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Sep 14 2000