OFFSET
1,1
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..10000
EXAMPLE
64 = 4^3 is a cube and 4 <= 6, thus 6 is a term.
343 = 7^3 is a cube and 3 <= 34, thus 34 is a term.
1000 = 10^3 is a cube and 0 <= 100, thus 100 is a term.
5359375 = 175^3 is a cube and 375 <= 5359, thus 5359 is a term.
MAPLE
filter:= proc(n) local d, a, b, r, rmin, i;
for d from 1 to ilog10(n)+1 do
a:=ceil((10^d*n)^(1/3));
b:= floor((10^d*(n+1))^(1/3));
if d = 1 then rmin:= 0 else rmin:= 10^(d-1) fi;
for i from a to b do
r:= i^3 -10^d*n;
if r >= min(10^d, n+1) then break fi;
if r < rmin then next fi;
return true
od
od;
false
end proc:
select(filter, [$1..1000]); # Robert Israel, Feb 22 2023
PROG
(Python)
from itertools import count, islice
from sympy import integer_nthroot
def A360570_gen(startvalue=1): # generator of terms >= startvalue
for n in count(max(startvalue, 1)):
if integer_nthroot(m:=10*n, 3)[1]:
yield n
else:
a = 1
while (k:=(integer_nthroot(a*(m+1)-1, 3)[0]+1)**3-m*a)>=10*a:
a *= 10
if a > n:
break
else:
if k <= n:
yield n
(PARI) is(n) = { for (k=0, n, if (ispower(n*10^max(1, #digits(k))+k, 3), return (1))); return (0) } \\ Rémy Sigrist, Feb 20 2023
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Chai Wah Wu, Feb 20 2023
STATUS
approved