OFFSET
1,3
COMMENTS
Among first 22083 terms (up to 10^14), there are 19202 even and 2881 odd terms. Also note that in odd terms, the only odd digit is the last one. - Zak Seidov, Apr 17 2016
From Robert Israel, Apr 18 2016: (Start)
For any k>=1, (10^k-2)^2 is a member of the sequence with the first k-1 digits odd and the last k+1 even, while (2*10^k+2)^2 = 4*10^(2*k)+8*10^k+4 is a member with all digits even, and (2*10^k+1)^2 is an odd member.
If x is an even member, then so is 100*x. (End)
LINKS
Zak Seidov, Table of n, a(n) for n = 1..22083
FORMULA
a(n) = A030477(n)^2. - Andrew Howroyd, Aug 11 2024
EXAMPLE
a(21055) = 9427771^2 = 88882866028441, - Zak Seidov, Apr 18 2016
a(21056) = 9427980^2 = 88886806880400. - Robert Israel, Apr 18 2016
MAPLE
filter:= proc(n) local L, evens, odds;
L:= convert(n, base, 10) mod 2;
evens:= select(t -> L[t]::even, [$1..nops(L)]);
odds:= select(t -> L[t]::odd, [$1..nops(L)]);
(evens = []) or (odds = []) or (evens[1]>odds[-1]) or (odds[1]>evens[-1])
end proc:
select(filter, [seq(i^2, i=0..100)]); # Robert Israel, Apr 18 2016
MATHEMATICA
Select[Range[0, 80]^2, Function[k, Or[Flatten@ # == k, Flatten@ Reverse@ # == k] &@ GatherBy[k, EvenQ]]@ IntegerDigits@ # &] (* Michael De Vlieger, Apr 17 2016 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Offset corrected by Andrew Howroyd, Aug 11 2024
STATUS
approved