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.

A370884 Irregular triangle read by rows: T(n,k) is the number of unmatched left parentheses in the k-th string of parentheses of length n, where strings within a row are in reverse lexicographical order.

This page as a plain text file.
%I A370884 #26 Mar 13 2024 04:42:32
%S A370884 0,0,1,0,1,0,2,0,1,0,2,0,1,1,3,0,1,0,2,0,1,1,3,0,1,0,2,0,2,2,4,0,1,0,
%T A370884 2,0,1,1,3,0,1,0,2,0,2,2,4,0,1,0,2,0,1,1,3,0,1,1,3,1,3,3,5,0,1,0,2,0,
%U A370884 1,1,3,0,1,0,2,0,2,2,4,0,1,0,2,0,1,1,3,0
%N A370884 Irregular triangle read by rows: T(n,k) is the number of unmatched left parentheses in the k-th string of parentheses of length n, where strings within a row are in reverse lexicographical order.
%C A370884 See A370883 for more information.
%C A370884 The first half of each row n >= 1 is equal to row n-1.
%D A370884 Donald E. Knuth, The Art of Computer Programming, Vol. 4A: Combinatorial Algorithms, Part 1, Addison-Wesley, 2011, Section 7.2.1.6, p. 459.
%H A370884 Paolo Xausa, <a href="/A370884/b370884.txt">Table of n, a(n) for n = 0..16382</a> (rows 0..13 of the triangle, flattened).
%F A370884 T(n,k) = A370885(n,k) - A370883(n,k).
%e A370884 Triangle begins:
%e A370884   [0] 0;
%e A370884   [1] 0 1;
%e A370884   [2] 0 1 0 2;
%e A370884   [3] 0 1 0 2 0 1 1 3;
%e A370884   [4] 0 1 0 2 0 1 1 3 0 1 0 2 0 2 2 4;
%e A370884   ...
%e A370884 The strings corresponding to row 2, in reverse lexicographical order, are:
%e A370884   "))" (0 unmatched left parentheses),
%e A370884   ")(" (1 unmatched left parenthesis),
%e A370884   "()" (0 unmatched left parentheses), and
%e A370884   "((" (2 unmatched left parentheses).
%t A370884 countL[s_] := StringCount[s, "1"] - StringCount[StringJoin[StringCases[s, RegularExpression["1(?R)*+0"]]], "1"];
%t A370884 Array[Map[countL, IntegerString[Range[0, 2^#-1], 2, #]] &, 7, 0]
%Y A370884 Cf. A370883, A370885.
%Y A370884 Cf. A000079 (row lengths).
%Y A370884 Apparently, row sums are given by A189391.
%K A370884 nonn,tabf
%O A370884 0,7
%A A370884 _Paolo Xausa_, Mar 06 2024