TOPICS
Search

Halving Recamán Sequence


HalvingRecamanSequence

The halving Recamán sequence is the integer sequence obtained by starting with a(1)=1 and then halving the preceding term when the result is an unvisited integer, otherwise adding the current index (Pegg 2026). For n>=2, its rule is

 a(n)={(a(n-1))/2   if a(n-1) is even and a(n-1)/2 not in {a(1),...,a(n-1)}; a(n-1)+n   otherwise.
(1)

The first terms are 1, 3, 6, 10, 5, 11, 18, 9, 18, 28, 14, 7, ... (OEIS A400939). The plot above shows the first 333 terms. This sequence received an honorable mention in the OEIS 400K celebration contest (OEIS Foundation Inc. 2026).

This rule replaces the subtraction step in Recamán's sequence by halving. Only the halving branch requires a previously unseen value. In particular, the repeated value a(9)=18=a(7) is allowed. It is conjectured that every positive integer eventually occurs. For example, 2 first appears at position 102, while 12 first appears at position 333.


See also

Integer Sequence, Recamán's Sequence

Explore with Wolfram|Alpha

References

OEIS Foundation Inc. "A400K Winners." 2026. https://oeis.org/wiki/A400K_Winners. Pegg, E. Jr. "Winners of the OEIS 400K Milestone Contest." Wolfram Community. Oct. 26, 2026. https://community.wolfram.com/t/28423.Sloane, N. J. A. Sequence A400939 in "The On-Line Encyclopedia of Integer Sequences."

Cite this as:

Weisstein, Eric W. "Halving Recamán Sequence." From MathWorld--A Wolfram Resource. https://mathworld.wolfram.com/HalvingRecamanSequence.html

Subject classifications