cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A353342 Numbers k such that k and k^3 use only even digits.

This page as a plain text file.
%I A353342 #15 May 06 2022 19:59:58
%S A353342 0,2,4,20,40,200,202,400,2000,2002,2020,4000,20000,20002,20020,20200,
%T A353342 40000,200000,200002,200020,200200,202000,400000,2000000,2000002,
%U A353342 2000020,2000200,2002000,2020000,4000000,20000000,20000002,20000020,20000200,20000202,20002000,20002002,20020000,20200000
%N A353342 Numbers k such that k and k^3 use only even digits.
%C A353342 Numbers k such that k^3 has only even digits are in A052004.
%t A353342 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 *)
%o A353342 (Python)
%o A353342 from itertools import count, islice, product
%o A353342 def agen(): # generator of terms
%o A353342     for digits in count(1):
%o A353342         for p in product("02468", repeat=digits):
%o A353342             if len(p) > 1 and p[0] == "0": continue
%o A353342             k = int("".join(p))
%o A353342             if set(str(k**3)) <= set("02468"):
%o A353342                 yield k
%o A353342 print(list(islice(agen(), 40))) # _Michael S. Branicky_, May 06 2022
%Y A353342 Cf. A085597 (similar, but with odd digits).
%Y A353342 Intersection of A014263 and A052004.
%K A353342 nonn,base
%O A353342 1,2
%A A353342 _Bernard Schott_, May 06 2022