OFFSET
1,2
LINKS
Giovanni Resta, Table of n, a(n) for n = 1..10000 (first 2000 terms from Robert Israel)
MAPLE
alp:= proc(n) local L, d;
L:= convert(n, base, 10);
d:= nops(L);
if d::even then L:= L + map(op, [[0, 1]$(d/2)]) else L:= L + map(op, [[0, 1]$((d-1)/2), [0]]) fi;
nops(convert(L mod 2, set))=1
end proc:
select(t -> alp(t^2), [seq(i, i=0..10000, 2)]); # Robert Israel, Aug 15 2018
MATHEMATICA
id[n_]:=IntegerDigits[n^2]; t={}; Do[If[Length[id[n]]==1, AppendTo[t, n], If[Union[Abs[Differences[Boole/@EvenQ[id[n]]]]]=={1}, AppendTo[t, n]]], {n, 0, 6000, 2}]; t (* Vincenzo Librandi, Aug 15 2018 *)
Join[{0, 2}, Select[Range[0, 6000, 2], Union[Abs[Differences[Boole[OddQ[ IntegerDigits[ #^2]]]]]] == {1}&]] (* Harvey P. Dale, Sep 11 2024 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
EXTENSIONS
Offset changed by Robert Israel, Aug 15 2018
STATUS
approved