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.

A080901 a(1)=2; for n>1, a(n)=a(n-1)-2 if n is already in the sequence, a(n)=a(n-1)+5 otherwise.

Original entry on oeis.org

2, 0, 5, 10, 8, 13, 18, 16, 21, 19, 24, 29, 27, 32, 37, 35, 40, 38, 36, 41, 39, 44, 49, 47, 52, 57, 55, 60, 58, 63, 68, 66, 71, 76, 74, 72, 70, 68, 66, 64, 62, 67, 72, 70, 75, 80, 78, 83, 81, 86, 91, 89, 94, 99, 97, 102, 100, 98, 103, 101, 106, 104, 102, 100
Offset: 1

Views

Author

N. J. A. Sloane and Benoit Cloitre, Apr 01 2003

Keywords

Crossrefs

Programs

  • Mathematica
    Fold[Append[#1, #1[[-1]] + If[MemberQ[#1, #2], -2, 5]] &, {2}, Range[2, 64]] (* Ivan Neretin, Mar 03 2016 *)

Formula

a(n)-n (n >= 1) (A081745) is periodic with period 168.