OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
has02:= proc(n) local L, i, state;
L:= convert(n, base, 5);
state:= 1;
for i from 1 to nops(L) do
if L[i] = 0 then
if state = 2 then return true
else state:= 0
fi
elif L[i] = 2 then
if state = 0 then return true
else state:= 2
fi
else state:= 1;
fi
od;
false
end proc:
H:= select(has02, {$1..1001}):
sort(convert(H minus map(`+`, H, 1), list)); # Robert Israel, Jan 20 2019
MATHEMATICA
With[{s = Partition[Array[IntegerDigits[#, 5] &, 602], 2, 1]}, Map[FromDigits[#, 5] &, Select[s, And[And[SequenceCount[#1, {0, 2}] == 0, SequenceCount[#1, {2, 0}] == 0], Or[SequenceCount[#2, {0, 2}] > 0, SequenceCount[#2, {2, 0}] > 0]] & @@ # &][[All, -1]] ] ] (* Michael De Vlieger, Jan 20 2019 *)
CROSSREFS
KEYWORD
nonn,base
AUTHOR
STATUS
approved