OFFSET
1,2
COMMENTS
On the other hand, the only squares whose digits are all odd are 1 and 9, because the tens digit of all odd squares >= 25 (A016754) is always even. - Bernard Schott, Jan 24 2023
LINKS
Michael S. Branicky, Table of n, a(n) for n = 1..10000 (terms 1..1000 from T. D. Noe)
FORMULA
a(n) = A030097(n)^2. - Michel Marcus, Apr 03 2014
MATHEMATICA
t = {}; n = -1; While[Length[t] < 1000, n++; If[Intersection[IntegerDigits[n^2], {1, 3, 5, 7, 9}] == {}, AppendTo[t, n^2]]] (* T. D. Noe, Apr 03 2014 *)
Select[Range[0, 3000]^2, AllTrue[IntegerDigits[#], EvenQ]&] (* The program uses the AllTrue function from Mathematica version 10 *) (* Harvey P. Dale, Feb 19 2016 *)
PROG
(Python)
from math import isqrt
def ok(sq): return all(d in "02468" for d in str(sq))
def aupto(limit):
sqs = (i*i for i in range(0, isqrt(limit)+1, 2))
return list(filter(ok, sqs))
print(aupto(4080400)) # Michael S. Branicky, May 20 2021
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved