OFFSET
1,3
COMMENTS
A permutation [1...n] is heapable if it can be sequentially inserted into a binary min-heap without violating the heap property.
The longest decreasing subsequence (LDS) of a heapable permutation is a subsequence of the given sequence in which the elements are in strictly decreasing order and the subsequence is as long as possible.
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..n} k*A390146(n,k).
EXAMPLE
For n=4 the heapable permutations and their LDS lengths:
(1,2,3,4): LDS=1 (no decreasing pair).
(1,3,2,4): LDS=2 (subsequence 3,2).
(1,2,4,3): LDS=2 (subsequence 4,3).
(1,4,2,3): LDS=2 (subsequence 4,2).
(1,3,4,2): LDS=2 (subsequence 4,2).
So the total LDS-sum is 1*1+2*4=9.
CROSSREFS
KEYWORD
nonn,more
AUTHOR
Manolopoulos Panagiotis, Oct 31 2025
EXTENSIONS
a(11)-a(15) from Sean A. Irvine, Nov 03 2025
STATUS
approved
