I follow below question to generate binary sequence
but number of sequence is 6 not 5, why 011001 is wrong?
number of sequence should be catalan number.
how to generate this kind of sequence correctly?
For ecah positive integer n, how many 2n-digit binary sequence
b1,b2,b2n with n "0" and n "1" are there such that
for each i=1,2,...2n, the number of "0" is larger than or equal
to the number of "1" in the subsequence b1,b2,...bi?
source := permute(Flatten([seq([0,0,0,1,1,1], k=1..1)]), 6);
aavxa := :
for z in source do
if Summation(z[k], k = 1 .. nops(z)) = 3 then
if z[nops(z)] = 1 and z = 0 then
if Reverse(z) in aavxa then
aavxa := [op(aavxa), z];