TOPICS
Search

Recamán's Sequence


RecamansSequence

There are at least two sequences attributed to B. Recamán. One is the sequence a_n formed by taking a_1=1 and letting

 a_n={a_(n-1)-n   if a_(n-1)-n>0 and is new; a_(n-1)+n   otheriwse,
(1)

which can be succinctly defined as "subtract if you can, otherwise add." The first few terms are 1, 3, 6, 2, 7, 13, 20, 12, 21, 11, ... (OEIS A005132), illustrated above.

RecamansSequenceBinary

A view of the first 256 terms as binary bits is shown above.

The terms 1, 2, 3, ... occur at positions 1, 4, 2, 131, 129, 3, 5, ... (OEIS A057167). The high-water marks in this sequence are 1, 4, 131, 99734, 181653, 328002, ... (OEIS A064227), which occur at positions 1, 2, 4, 19, 61, 879, ... (OEIS A064228).

Another sequence defined by Recamán is the sequence obtained by letting a_1=1 and defining

 a_n={(a_(n-1))/(n-1)   if (n-1)|a_(n-1); (n-1)a_(n-1)   otherwise
(2)

(Guy and Nowakowski 1995, Sloane 1999). The first few terms of this sequence are 1, 1, 2, 6, 24, 120, 20, 140, 1120, ... (OEIS A008336).


Explore with Wolfram|Alpha

WolframAlpha

More things to try:

References

Guy, R. K. and Nowakowski, R. J. "Monthly Unsolved Problems, 1696-1995." Amer. Math. Monthly 102, 921-926, 1995.Sloane, N. J. A. Sequences A005132/M2511, A008336, A057167, A064227, and A064228 in "The On-Line Encyclopedia of Integer Sequences."Sloane, N. J. A. "My Favorite Integer Sequences." In Sequences and Their Applications (Proceedings of SETA '98) (Ed. C. Ding, T. Helleseth, and H. Niederreiter). London: Springer-Verlag, pp. 103-130, 1999. http://www.research.att.com/~njas/doc/sg.pdf.

Referenced on Wolfram|Alpha

Recamán's Sequence

Cite this as:

Weisstein, Eric W. "Recamán's Sequence." From MathWorld--A Wolfram Web Resource. https://mathworld.wolfram.com/RecamansSequence.html

Subject classifications