OFFSET
0,3
COMMENTS
This sequence is a variant of A377091 that, by design, contains every integer (positive or negative).
Positive values appear in increasing order, negative values appear in decreasing order.
LINKS
Rémy Sigrist, Table of n, a(n) for n = 0..10000
Rémy Sigrist, PARI program
EXAMPLE
a(0) = 0 and a(1) = 1 by definition.
At this point, the least value (in absolute value) not yet in the sequence and of opposite sign is -1.
a(1) is not at square distance from -1, so a(2) = 1 + sign(1) = 2.
a(2) is not at square distance from -1, so a(3) = 2 + sign(2) = 3.
a(3) is at square distance from -1, so a(4) = -1.
At this point, the least value (in absolute value) not yet in the sequence and of opposite sign is 4.
a(4) is not at square distance from 4, so a(5) = -1 + sign(-1) = -2.
PROG
(PARI) \\ See Links section.
CROSSREFS
KEYWORD
sign,easy,new
AUTHOR
Rémy Sigrist, Jan 22 2025
STATUS
approved