%I #21 Sep 08 2022 08:46:26
%S 0,4,400,40000,2244004,4000000,42224004,224400400,400000000,424442404,
%T 4222400400,22200404004,22440040000,40000000000,42444240400,
%U 422240040000,2220040400400,2244004000000,4000000000000,4024044024004,4244424040000,40244204444224,42224004000000
%N Squares composed of digits {0,2,4}.
%C From _Marius A. Burtea_, Nov 18 2021: (Start)
%C The sequence is infinite because if m > 0 is a term, then 100*m is also a term.
%C Also, the squares of the numbers 20602, 2006002, 200060002, ..., (2*10^(2*k) + 6*10^k + 2), k >= 2, are 424442404, 4024044024004, 40024004400240004, 400024000440002400004, ... and have only the digits 0, 2 and 4 and are not divisible by 100. (End)
%t Select[Range[0, 10^7, 2]^2, AllTrue[IntegerDigits[#], MemberQ[{0, 2, 4}, #1] &] &] (* _Amiram Eldar_, Nov 18 2021 *)
%o (C#)
%o for(ulong num = 0; num < 10000000; num++)
%o {
%o ulong sq = num * num;
%o string sq1 = sq + "";
%o bool p = true;
%o string un = "1356789";
%o for(int a = 0; a < un.Length; a++)
%o {
%o if(sq1.Contains(un[a]))
%o {
%o p = false;
%o }
%o }
%o if(p)
%o {
%o Console.Write(sq1 + ", ");
%o }
%o }
%o Console.WriteLine("done");
%o (Magma) [n : n in [s*s:s in [1..1500000]]|Set(Intseq(n)) subset {0,2,4}]; // _Marius A. Burtea_, Nov 18 2021
%o (Python)
%o from itertools import islice, count
%o def A349460(): return filter(lambda n: set(str(n)) <= {'0','2','4'},(n*n for n in count(0)))
%o A349460_list = list(islice(A349460(),20)) # _Chai Wah Wu_, Nov 19 2021
%Y Subsequence of A000290 and A030098.
%K nonn,base
%O 1,2
%A _Daniel Blam_, Nov 18 2021
|