1,1

Robert Israel, Table of n, a(n) for n = 1..10000

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

Sequence in context: A184332 A326711 A050098 * A288474 A310026 A213732

Adjacent sequences: A025509 A025510 A025511 * A025513 A025514 A025515

nonn

David W. Wilson

approved