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.

A238324 a(1) = 1 and a(n+1) = if a(n) > 2*n+1 then a(n)-2*n-1 else a(n)+2*n+1.

Original entry on oeis.org

1, 4, 9, 2, 11, 22, 9, 24, 7, 26, 5, 28, 3, 30, 1, 32, 65, 30, 67, 28, 69, 26, 71, 24, 73, 22, 75, 20, 77, 18, 79, 16, 81, 14, 83, 12, 85, 10, 87, 8, 89, 6, 91, 4, 93, 2, 95, 190, 93, 192, 91, 194, 89, 196, 87, 198, 85, 200, 83, 202, 81, 204, 79, 206, 77
Offset: 1

Views

Author

Reinhard Zumkeller, Dec 07 2015

Keywords

Comments

Abs(a(n+1) - a(n)) = 2*n+1;
a(A265327(n)) = n and a(m) != n for m < A265327(n).

Crossrefs

Programs

  • Haskell
    a238324 n = a238324_list !! (n-1)
    a238324_list = scanl1 (\u v -> if u > v then u - v else u + v) [1, 3 ..]
  • Mathematica
    nxt[{n_,a_}]:={n+1,If[a>2n+1,a-2n-1,a+2n+1]}; NestList[nxt,{1,1},70][[All,2]] (* Harvey P. Dale, Oct 07 2016 *)