OFFSET
1,3
COMMENTS
A permutation is heapable if its elements can be inserted into a binary min-heap in breadth-first order without violating the heap property.
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 file
EXAMPLE
For n=4: There are 5 heapable permutations: (1,2,3,4), (1,2,4,3), (1,3,2,4), (1,3,4,2), (1,4,2,3). Positions of element 2 (0-based): 1,1,2,3,2. Their sum = 9.
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Manolopoulos Panagiotis, Nov 06 2025
EXTENSIONS
a(12)-a(16) from Sean A. Irvine, Nov 12 2025
STATUS
approved
