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.

A335299 a(0) = 0; for n > 0, a(n) = abs(a(n-1) - n) if not already in the sequence, otherwise a(n) = a(n-1) + n.

Original entry on oeis.org

0, 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, 22, 10, 23, 9, 24, 8, 25, 43, 62, 42, 63, 41, 18, 42, 17, 43, 16, 44, 15, 45, 14, 46, 79, 113, 78, 114, 77, 39, 78, 38, 79, 37, 80, 36, 81, 35, 82, 34, 83, 33, 84, 32, 85, 31, 86, 30, 27, 85, 26, 86, 147, 209, 146, 210
Offset: 0

Views

Author

Rémy Sigrist, May 31 2020

Keywords

Comments

This sequence is a variant of Recamán's sequence (A005132).
This sequence first differ from A005132 for n = 57: a(57) = 27 whereas A005132(57) = 87.
Up to about 1.7 million terms the sequence values are concentrated along lines of integer gradient - see the image of the first 100000 terms. However beyond that each of these lines splits into two which subsequently cross and form a pattern reminiscent of a Cat's Cradle figure. See the linked images of the first 2 million and 20 million terms. - Scott R. Shannon, Jan 18 2021

Crossrefs

Programs

  • PARI
    { rr = 0; r = 0; for (n=0, 64, if (!bittest(rr, m=abs(r-n)), r = m, r = r+n;); rr = bitor(rr, 2^r); print1 (r", ")) }