OFFSET
1,2
COMMENTS
Numbers k such that k^3 has only even digits are in A052004.
MATHEMATICA
seq[ndigmax_] := Module[{nums = Tuples[{0, 2, 4, 6, 8}, ndigmax]}, Select[FromDigits /@ nums, AllTrue[IntegerDigits[#^3], EvenQ] &]]; seq[8] (* Amiram Eldar, May 06 2022 *)
PROG
(Python)
from itertools import count, islice, product
def agen(): # generator of terms
for digits in count(1):
for p in product("02468", repeat=digits):
if len(p) > 1 and p[0] == "0": continue
k = int("".join(p))
if set(str(k**3)) <= set("02468"):
yield k
print(list(islice(agen(), 40))) # Michael S. Branicky, May 06 2022
CROSSREFS
KEYWORD
nonn,base
AUTHOR
Bernard Schott, May 06 2022
STATUS
approved