login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A335282
Lexicographically earliest strictly increasing sequence of positive integers whose Recamán transform has only distinct values.
1
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72
OFFSET
1,2
COMMENTS
The Recamán transform of a sequence {b(n), n>0} is the sequence {r(n), n>=0} defined as follows: r(0) = 0; for n > 0, r(n) = r(n-1) - b(n) if nonnegative and not already in the sequence, otherwise r(n) = r(n-1) + b(n).
This sequence has large runs of consecutive terms.
The Recamán transform of this sequence, say r, first differ from A064388 for n = 123: r(123) = 19 whereas A064388(123) = 300.
PROG
(PARI) { rr = 2^r=0; for (v=1, 72, forstep (s=-1, +1, 2, if (r+s*v>=0 && !bittest(rr, r+s*v), rr += 2^r+=s*v; print1 (v ", "); break))) }
CROSSREFS
Sequence in context: A048242 A272076 A335280 * A370133 A351576 A132264
KEYWORD
nonn
AUTHOR
Rémy Sigrist, May 30 2020
STATUS
approved