OFFSET
0,6
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 213-pattern in a heapable permutation p=(p1,p2..pn) is a triad of indices i<j<k where pj<pi<pk.
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
FORMULA
a(n) = Sum_{k>=1} k*A391508(n,k). - Andrew Howroyd, Dec 17 2025
EXAMPLE
For n=4 the heapable permutations are:
(1,2,3,4): 0 213 patterns.
(1,3,2,4): (3,2,4) => 1 213 pattern.
(1,2,4,3): 0 213 patterns.
(1,3,4,2): 0 213 patterns.
(1,4,2,3): 0 213 patterns.
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Manolopoulos Panagiotis, Dec 17 2025
EXTENSIONS
a(11)-a(15) from Sean A. Irvine, Dec 22 2025
a(0)=0 inserted by Sean A. Irvine, Jan 26 2026
STATUS
approved
