login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
Sequence in context: A035026 A224962 A173540 * A070770 A292599 A071487
KEYWORD
sign
AUTHOR
Rémy Sigrist, Jul 15 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 20 00:03 EDT 2024. Contains 371798 sequences. (Running on oeis4.)