login
Numbers k such that k^3 has only odd digits.
5

%I #33 Jul 28 2021 04:16:14

%S 1,11,15,33,39,71,91,173,175,179,211,259,335,3337,4631,5597,7353,

%T 12415,21353,22893,25799,69491,110011,124975,199831,227353,237151,

%U 462815,492415,708415,1100033,2393695,2620611,5088493,5828415,7204417,8320335,11164415,11689633

%N Numbers k such that k^3 has only odd digits.

%H Giovanni Resta, <a href="/A030099/b030099.txt">Table of n, a(n) for n = 1..563</a> (terms < 10^19, first 75 terms from Reinhard Zumkeller, terms 76..151 from Max Alekseyev)

%t fQ[n_] := Union@ OddQ@ IntegerDigits[n^3] == {True}; Select[2 Range[3*10^6] - 1, fQ] (* _Robert G. Wilson v_, Aug 13 2011 *)

%t Select[Range[12*10^6],AllTrue[IntegerDigits[#^3],OddQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* _Harvey P. Dale_, Apr 14 2015 *)

%o (Haskell)

%o import Data.List (intersect)

%o a030099 n = a030099_list !! (n-1)

%o a030099_list = filter (null . (intersect "86420") . show . (^ 3)) [1,3..]

%o -- _Reinhard Zumkeller_, Aug 13 2011

%Y Cf. A000578, A030100, A034376, A052004.

%K nonn,base,nice

%O 1,2

%A _Patrick De Geest_