OFFSET
1,2
COMMENTS
A permutation of positive integers: letting s_n = (a(n) + (a(n-1) + ... + (a(1))^(1/3)...)^(1/3))^(1/3), we have a_n = s_n^3-s_{n-1}. We claim that if s_1,...s_{n-1} <= k, then s_n <=k+1. Indeed, the given condition implies a_1,...,a_{n-1} <= k^3. Since (k+1)^3-s_{n-1} >= k^3+3k^2+2k+1 > a_j for j < n and a_n is the smallest positive integer not already in the sequence for which a_n+s_{n-1} is a cube, then s_n <= k+1. Then we note that a_n = s_n^3-s_{n-1} cannot repeat, so that s_n cannot be a single constant infinitely often, so {s_n} contains every positive integer. Finally, for an integer k, k appears in the sequence {a_n} no later than the first time s_{n-1} = k^3-k.
PROG
(Python)
myList = [1]
s = 1
t = 0
for n in range(9999):
b = 2
while t == 0:
if(b**3-s > 0 and not b**3-s in myList):
myList.append(b**3-s)
s = b
t = 1
else:
b += 1
t=0
print("myList: ", myList)
(PARI) lista(nn) = {my(va = vector(nn), lastcb); va[1] = 1; lastcb = 1; for (n=2, nn, my(k = ceil(sqrtn(sqrtnint(lastcb, 3), 3))); while (#select(x->(x==(k^3-sqrtnint(lastcb, 3))), va), k++); va[n] = k^3-sqrtnint(lastcb, 3); lastcb = k^3; ); va; } \\ Michel Marcus, Oct 13 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Vincent Chan, Oct 12 2020
STATUS
approved