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.

A386947 A variant of Recamán's sequence (A005132): a(0) = 0; for n > 0, a(n) = a(n-1) - n if nonnegative and not already in the sequence, otherwise a(n) = a(n-1) + n + 2.

Original entry on oeis.org

0, 3, 1, 6, 2, 9, 17, 10, 20, 11, 23, 12, 26, 13, 29, 14, 32, 15, 35, 16, 38, 61, 39, 64, 40, 67, 41, 70, 42, 73, 43, 76, 44, 79, 45, 82, 46, 85, 47, 8, 50, 93, 51, 96, 52, 7, 55, 104, 56, 107, 57, 110, 58, 5, 61, 118, 62, 121, 63, 4, 66
Offset: 0

Views

Author

Jules Beauchamp, Aug 10 2025

Keywords

Comments

When visualized in connecting semicircular lines (like the original Recamán Sequence, cf. Edmund Harriss, "The first 65 steps drawn as a spiral" in A005132), it appears to produce conical spirals.
The first repeating term is 61.

Crossrefs

Programs

  • Mathematica
    a[n_] := a[n] = If[a[n-1] >= n && FreeQ[Table[a[k], {k, 0, n-1}], a[n-1] - n], a[n-1] - n, a[n-1] + n + 2]; a[0] = 0; Array[a, 100, 0] (* Amiram Eldar, Aug 22 2025 *)