cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A368751 Irregular triangle read by rows: T(n,k) is the number of co-atoms contained in the k-th balanced string of left/right parentheses of length 2*n, where strings within a row are in reverse lexicographical order.

Original entry on oeis.org

1, 0, 1, 2, 1, 1, 0, 0, 1, 1, 2, 1, 2, 3, 2, 2, 1, 1, 1, 2, 1, 1, 0, 0, 1, 0, 0, 0, 1, 1, 1, 2, 1, 1, 1, 2, 1, 2, 3, 2, 2, 1, 1, 2, 2, 3, 2, 3, 4, 3, 3, 2, 2, 2, 3, 2, 2, 1, 1, 2, 1, 1, 1, 1, 1, 2, 1, 2, 3, 2, 2, 1, 1, 1, 2, 1, 1, 0, 0, 1, 0, 0, 0, 1, 2, 1, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 0, 0
Offset: 1

Views

Author

Paolo Xausa, Jan 05 2024

Keywords

Comments

See A368750 for the definition of balanced strings and atoms/co-atoms.

Examples

			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).
		

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.

Crossrefs

Cf. A000346 (row sums), A000984 (row lengths), A362030 and A368804 (binary words).
Cf. A368750 (atoms), A368752 (all atoms), A368753 (defects).

Programs

  • Mathematica
    strings[n_]:=Permutations[PadLeft[PadLeft[{},n,1],2n,-1]];
    Array[Map[SequenceCount[Accumulate[#],{-1,0}]&,strings[#]]&,5]

Formula

T(n,k) = A368752(n,k) - A368750(n,k).