login
A349460
Squares composed of digits {0,2,4}.
1
0, 4, 400, 40000, 2244004, 4000000, 42224004, 224400400, 400000000, 424442404, 4222400400, 22200404004, 22440040000, 40000000000, 42444240400, 422240040000, 2220040400400, 2244004000000, 4000000000000, 4024044024004, 4244424040000, 40244204444224, 42224004000000
OFFSET
1,2
COMMENTS
From Marius A. Burtea, Nov 18 2021: (Start)
The sequence is infinite because if m > 0 is a term, then 100*m is also a term.
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)
MATHEMATICA
Select[Range[0, 10^7, 2]^2, AllTrue[IntegerDigits[#], MemberQ[{0, 2, 4}, #1] &] &] (* Amiram Eldar, Nov 18 2021 *)
PROG
(C#)
for(ulong num = 0; num < 10000000; num++)
{
ulong sq = num * num;
string sq1 = sq + "";
bool p = true;
string un = "1356789";
for(int a = 0; a < un.Length; a++)
{
if(sq1.Contains(un[a]))
{
p = false;
}
}
if(p)
{
Console.Write(sq1 + ", ");
}
}
Console.WriteLine("done");
(Magma) [n : n in [s*s:s in [1..1500000]]|Set(Intseq(n)) subset {0, 2, 4}]; // Marius A. Burtea, Nov 18 2021
(Python)
from itertools import islice, count
def A349460(): return filter(lambda n: set(str(n)) <= {'0', '2', '4'}, (n*n for n in count(0)))
A349460_list = list(islice(A349460(), 20)) # Chai Wah Wu, Nov 19 2021
CROSSREFS
Subsequence of A000290 and A030098.
Sequence in context: A115049 A307929 A202172 * A158111 A259049 A280791
KEYWORD
nonn,base
AUTHOR
Daniel Blam, Nov 18 2021
STATUS
approved