login
A391971
Triangle read by rows: T(n,k) = number of heapable permutations of length n with exactly k 321 patterns.
2
1, 1, 1, 2, 5, 14, 3, 42, 18, 11, 132, 82, 84, 27, 22, 11, 1, 429, 339, 456, 256, 243, 143, 124, 61, 43, 28, 4, 1430, 1341, 2158, 1638, 1766, 1227, 1321, 931, 749, 610, 466, 295, 198, 166, 131, 28, 21, 15, 4, 4862, 5187, 9511, 8837, 10588, 8516, 9954, 8164
OFFSET
0,4
COMMENTS
A permutation of [1..n] is heapable if it can be inserted, one element at a time, into a binary min-heap without violating the heap property.
A 321-pattern in a heapable permutation p = (p(1), p(2), ..., p(n)) is a triad of indices x < y < z where p(z) < p(y) < p(x).
LINKS
Benjamin Chen, Michael Cho, Mario Tutuncu-Macias, and Tony Tzolov, Efficient methods of calculating the number of heapable permutations, Discrete Applied Mathematics Volume 331, 31 May 2023, Pages 126-137.
Manolopoulos Panagiotis, Python Program.
EXAMPLE
Triangle begins:
1
1
1
2
5
14, 3
42, 18, 11
132, 82, 84, 27, 22, 11, 1
429, 339, 456, 256, 243, 143, 124, 61, 43, 28, 4
CROSSREFS
Cf. A336282 (heapable permutations), A391776 (triangle 231 patterns), A391697 (total 213 patterns), A391777 (total 231 patterns).
Sequence in context: A279176 A279876 A329494 * A016737 A279253 A279958
KEYWORD
nonn,tabf
AUTHOR
EXTENSIONS
Offset corrected and more terms from Sean A. Irvine, Jan 26 2026
STATUS
approved