OFFSET
1,3
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000 (first 1000 terms from Reinhard Zumkeller)
FORMULA
EXAMPLE
1296 is a term as 1, 2, 9 and 6 have odd and even parity alternately.
MAPLE
i := 0:for a from 1 to 1000 do b := a^2:g := ceil(log(b+1)/log(10)):iss := true:for j from 1 to g-1 do if((b mod 2)=1) then if((floor(b/10^j) mod 2)=((-1)^(j+1)+1)/2) then iss := false:end if:else if((floor(b/10^j) mod 2)=((-1)^j+1)/2) then iss := false:end if:end if:end do: if(iss=true) then i := i+1:c[i] := b:end if:end do:q := seq(c[k], k=1..i-1); # Sascha Kurz, Mar 23 2002
MATHEMATICA
altQ[n_] := n < 10 || Union[Total /@ Partition[ Mod[ IntegerDigits@n, 2], 2, 1]] == {1}; Select[ Range[0, 500]^2, altQ[#] &] (* Giovanni Resta, Aug 16 2018 *)
PROG
(Haskell)
a030152 n = a030152_list !! (n-1)
a030152_list = filter ((== 1) . a228710) a000290_list
-- Reinhard Zumkeller, Aug 31 2013
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Edited by N. J. A. Sloane, Aug 31 2009 at the suggestion of R. J. Mathar
Offset corrected by Reinhard Zumkeller, Aug 31 2013
STATUS
approved