|
|
A336264
|
|
a(0) = 0, and then the sequence alternates runs of distinct numbers with the same sign, the n-th run having abs(a(n)) terms; all positive numbers appear, in increasing order; all negative numbers appear, in decreasing order; a(1) = 1.
|
|
1
|
|
|
0, 1, -1, 2, 3, -2, -3, -4, 4, 5, -5, -6, -7, 6, 7, 8, 9, -8, -9, -10, -11, 10, 11, 12, 13, 14, -12, -13, -14, -15, -16, 15, 16, 17, 18, 19, 20, -17, -18, -19, -20, -21, -22, -23, 21, 22, 23, 24, 25, 26, -24, -25, -26, -27, -28, -29, -30, 27, 28, 29, 30, 31
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
This sequence has similarities with Golomb's sequence (A001462) and A113138.
Every integer appears once in this sequence.
|
|
LINKS
|
|
|
EXAMPLE
|
a(0) = 0 and a(1) = 1 by definition.
So the first run of positive terms has abs(a(1)) = 1 term.
a(2) starts the first run of negative terms: a(2) = -1; this run has abs(a(2)) = 1 term.
a(3) starts the second run of positive terms: a(3) = 2; this run has abs(a(3)) = 2 terms, so a(4) = 3.
a(5) starts the second run of negative terms and has abs(a(4)) = 3 terms: a(5) = -2, a(6) = -3, a(7) = -4.
|
|
PROG
|
(PARI) See Links section.
|
|
CROSSREFS
|
|
|
KEYWORD
|
sign
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|