OFFSET
1,1
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
N:= 10^3: # to get all terms <= N
B:= Vector(N):
B[1..4]:= <1, 1, 2, 1>:
m:= 4: t:= 2:
for n from 1 while m < N do
t:= 3-t;
B[m]:= t;
if B[n] = 2 and m+1 < N then
B[m+1]:= t; m:= m+2
else m:= m+1
fi
od:
select(t -> B[t]=2, [$1..N]); # Robert Israel, Nov 02 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved