login
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
MATHEMATICA
A379854list[nmax_] := Module[{s, a = 0, an, u = 1}, s[_] := False; s[0] = True; Join[{0}, Table[a = (While[s[u] && s[-u], u++]; an = u; While[s[an] || !IntegerQ[CubeRoot[Abs[a - an]]], an = Boole[an < 0] - an]; s[an] = True; an), nmax]]];
A379854list[100] (* Paolo Xausa, Feb 06 2025 *)
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: A383788 A167831 A090281 * A316823 A372982 A051951
KEYWORD
sign
AUTHOR
Rémy Sigrist, Jan 04 2025
STATUS
approved