OFFSET
1,1
COMMENTS
LINKS
Robert Israel, Table of n, a(n) for n = 1..10000
MAPLE
N:= 10000: # to use A022300(1..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:
S:= ListTools:-PartialSums(convert(B, list)):
select(t -> S[t] = 3/2*t, [$1..nops(S)]); # Robert Israel, Nov 02 2016
CROSSREFS
KEYWORD
nonn
AUTHOR
STATUS
approved