OFFSET
1,4
COMMENTS
See A368750 for the definition of balanced strings and atoms/co-atoms.
REFERENCES
Donald E. Knuth, The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms, Part 1, Addison-Wesley, 2011, Section 7.2.1.6, exercise 60, p. 478.
LINKS
Paolo Xausa, Table of n, a(n) for n = 1..17576 (rows 1..8 of the triangle, flattened).
EXAMPLE
Triangle begins:
[1] 1 0;
[2] 1 2 1 1 0 0;
[3] 1 1 2 1 2 3 2 2 1 1 1 2 1 1 0 0 1 0 0 0;
...
The strings corresponding to row 2, in reverse lexicographical order, are:
"))((" (1 co-atom),
")()(" (2 co-atoms),
")(()" (1 co-atom),
"())(" (1 co-atom),
"()()" (0 co-atoms) and
"(())" (0 co-atoms).
MATHEMATICA
strings[n_]:=Permutations[PadLeft[PadLeft[{}, n, 1], 2n, -1]];
Array[Map[SequenceCount[Accumulate[#], {-1, 0}]&, strings[#]]&, 5]
CROSSREFS
KEYWORD
nonn,tabf
AUTHOR
Paolo Xausa, Jan 05 2024
STATUS
approved