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.

A102568 a(n+1) = if a(n-1)=a(n)-1 then 2*a(n) else smallest number not occurring earlier; a(1)=1, a(2)=2.

Original entry on oeis.org

1, 2, 4, 3, 5, 6, 12, 7, 8, 16, 9, 10, 20, 11, 13, 14, 28, 15, 17, 18, 36, 19, 21, 22, 44, 23, 24, 48, 25, 26, 52, 27, 29, 30, 60, 31, 32, 64, 33, 34, 68, 35, 37, 38, 76, 39, 40, 80, 41, 42, 84, 43, 45, 46, 92, 47, 49, 50, 100, 51, 53, 54, 108, 55, 56, 112, 57, 58, 116, 59, 61
Offset: 1

Views

Author

Reinhard Zumkeller, Jan 15 2005

Keywords

Comments

Permutation of the natural numbers with inverse A102569;
a(n) <= 2*n; a(n) <> n for n>6;
A102570(n) = a(a(n)).

Programs

  • Mathematica
    Nest[Append[#, If[#[[-1]] == #[[-2]] + 1, 2 #[[-1]], Min[Complement[Range[Max[#] + 1], #]]]] &, {1, 2}, 69] (* Ivan Neretin, Sep 08 2015 *)