This site is supported by donations to The OEIS Foundation.
Recamán's sequence
From OeisWiki
There are two sequences that may be referred to as Recamán’s sequence.
Contents
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 |
n > 0, a (n) = a (n − 1) − n |
a (n) = a (n − 1) + n |
- {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 , ...}
n, n ≥ 1, |
n |
- {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 |
n ∣ a (n − 1) |
a (n) = (a (n − 1)) ⋅ n |
- {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) |
a (n − 1) |
n |
a (n) = (a (n − 1)) n |
- {2, 4, 64, 16777216, 1329227995784915872903807060280344576, 1048576, 1393796574908163946345982392040522594123776, ...}
1 ≤ n ≤ 5 |
a (n) = 2 n! |
(n) |
Notes
External links
- Weisstein, Eric W., Recamán’s Sequence, from MathWorld—A Wolfram Web Resource.
- Cleve’s Corner: Cleve Moler on Mathematics and Computing, The OEIS and the Recamán Sequence. © 1994-2018 The MathWorks, Inc.