This site is supported by donations to The OEIS Foundation.

Recamán's sequence

From OeisWiki
Jump to: navigation, search


This article page is a stub, please help by expanding it.


There are two sequences that may be referred to as Recamán’s sequence.

First Recamán’s sequence: “subtract if possible, otherwise add”

The first sequence (A005132) is a sequence of nonnegative integers separated by steps that can be described as “subtract if possible, otherwise add”:
a (0) = 0
; for
n > 0, a (n) = a (n  −  1)  −  n
if that number is positive and not already in the sequence, otherwise
a (n) = a (n  −  1) + n
, whether or not that number is already in the sequence. Look at the graph, or listen!
{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, 87, 29, 88, 28, 89, 27, 90, 26, 91, 157, 224, 156, 225, 155, ...}

N. J. A. Sloane named this sequence “Recamán’s sequence” after Bernardo Recamán and originally conjectured that this sequence includes every nonnegative integer at least once (but later recanted on the certainty of this conjecture).

A160357 Sign of first differences of [first] Recamán’s sequence (A005132).

{1, 1, 1, −1, 1, 1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, 1, 1, −1, 1, −1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, 1, 1, −1, 1, −1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, −1, 1, 1, 1, −1, 1, −1 , ...}
A057167 Term in Recamán’s sequence (A005132) where
n, n   ≥   1,
appears for first time, or 0 if
n
never appears.
{1, 4, 2, 131, 129, 3, 5, 16, 14, 12, 10, 8, 6, 31, 29, 27, 25, 23, 99734, 7, 9, 11, 13, 15, 17, 64, 62, 60, 58, 56, 54, 52, 50, 48, 46, 44, 42, 40, 38, 111, 22, 20, 18, 28, 30, 32, 222, 220, 218, 216, 214, 212, 210, 208, 206, 204, 202, 200, 198, 196, ...}

Second Recamán’s sequence: “divide if possible, otherwise multiply”

The second sequence by Recamán (A008336) can be described as “divide if possible, otherwise multiply”:
a (1) = 1; a (n) = (a  (n  −  1))  / n
if
na (n  −  1)
, otherwise
a (n) = (a (n  −  1))  ⋅  n
. (Verify: Should it say, or not, [only] for the divide part: if that number is not already in the sequence?.)[1]
{1, 1, 2, 6, 24, 120, 20, 140, 1120, 10080, 1008, 11088, 924, 12012, 858, 12870, 205920, 3500640, 194480, 3695120, 184756, 3879876, 176358, 4056234, 97349616, 2433740400, 93605400, 2527345800, ...}

A?????? Sign of logarithm of first quotients of [second] Recamán’s sequence (A008336).  (Add to OEIS?.)[2]

{0, 1, 1, 1, 1, −1, 1, 1, 1, −1, 1, −1, 1, −1, 1, 1, 1, −1, 1, −1, 1, −1, 1, 1, 1, −1, 1, ...}

A possible third sequence: “take root if possible, otherwise take power”

A possible third sequence: “take root if possible, otherwise take power”.

A??????
a (1) = 2; a (n) =
n  a (n  −  1)
if
a (n  −  1)
is an
n
th power, otherwise
a (n) = (a (n  −  1)) n
.  (Add to OEIS?.)[3]
{2, 4, 64, 16777216, 1329227995784915872903807060280344576, 1048576, 1393796574908163946345982392040522594123776, ...}
Note that only for
1   ≤   n   ≤   5
, does
a (n) = 2n!
= A050923
 (n)
.

Notes

  1. Needs verification (Should it say, or not, [only] for the divide part: if that number is not already in the sequence?).
  2. Add sequence to OEIS?
  3. Add sequence to OEIS?

External links