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”).

A379854
a(0) = 0, and for any n > 0, a(n) is the least integer (in absolute value) not yet in the sequence such that the absolute difference of a(n-1) and a(n) is a cube; in case of a tie, preference is given to the positive value.
1
0, 1, 2, 3, 4, -4, -3, -2, -1, 7, 6, 5, 13, 12, 11, 10, 9, 8, 16, -11, -10, -9, -8, -7, -6, -5, -13, -12, 15, 14, 22, 21, 20, 19, 18, 17, 25, 24, 23, 31, 30, 29, 28, 27, 26, 34, -30, -22, -14, -15, -16, -17, -18, -19, -20, -21, -29, -28, -27, -26, -25, -24
OFFSET
0,3
COMMENTS
A variant of A377091 based on cubes instead of squares.
Conjecture: Every integer (positive or negative) appears in this sequence.
LINKS
Rémy Sigrist, PARI program
EXAMPLE
The initial terms are:
n a(n) |a(n)-a(n-1)|
-- ---- -------------
0 0 N/A
1 1 1^3
2 2 1^3
3 3 1^3
4 4 1^3
5 -4 2^3
6 -3 1^3
7 -2 1^3
8 -1 1^3
9 7 2^3
10 6 1^3
11 5 1^3
12 13 2^3
13 12 1^3
14 11 1^3
PROG
(PARI) \\ See Links section.
(Python)
from sympy import integer_nthroot
from itertools import count, islice
def cond(n): return integer_nthroot(n, 3)[1]
def agen(): # generator of terms
an, aset, m = 0, {0}, 1
for n in count(0):
yield an
an = next(s for k in count(m) for s in [k, -k] if s not in aset and cond(abs(an-s)))
aset.add(an)
while m in aset and -m in aset: m += 1
print(list(islice(agen(), 62))) # Michael S. Branicky, Jan 04 2025
CROSSREFS
Cf. A377091.
Sequence in context: A301297 A167831 A090281 * A316823 A372982 A051951
KEYWORD
sign,new
AUTHOR
Rémy Sigrist, Jan 04 2025
STATUS
approved