OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
f:= proc(n) local L;
L:= [-1, op(convert(n, base, 3)), -1];
L:= L[1..-2]-L[2..-1];
L:= select(t -> L[t]<>0, [$1..nops(L)]);
L:= L[2..-1]-L[1..-2];
convert(L mod 2, `+`)*2 = nops(L)
end proc:
select(f, [$1..1000]); # Robert Israel, Jun 11 2019
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved