A single-cell rank recurrence for terminal-minimum stack sorting
How many permutations of \(0,\ldots,n\) ending in \(0\) are sorted by at most \(t\) applications of West's stack-sorting map? A single-cell recurrence gives the count \(a_{t,n}\) for every \(n\ge0\) and fixed integer \(t\ge2\), including the range \(t\ge3\) asked for by Jerry Zhang. For a word \(LMR\) of distinct entries with maximum \(M\), the map is \(s(LMR)=s(L)s(R)M\), with the empty word fixed. Here \(n\) counts the positive entries, so the word length is \(n+1\). The recurrence uses Zhang's weighted tableaux. For \(n\ge1\), the row widths \((\alpha_1,\ldots,\alpha_\ell)\) form a composition of \(n\) with each part at most \(t\). Labels \(1,\ldots,n\) decrease strictly from left to right in each row and down each column. Each tableau contributes the product of its hook weights. The weights in columns 1 and 2 are one. For column \(i\ge3\) of row \(j\), the weight is \[j_* = \max\bigl(\{b<j:\alpha_b\ge i-1\}\cup\{0\}\bigr),\qquad h(i,j)=\sum_{j_*<b<j}\alpha_b+i-1. \] Thus the pre-insertion weight is read from the number of cells added since the last completed row of width at least \(i-1\). A new rank \(q\) lies below a predecessor of old rank \(r\) exactly when \(q\le r\), so insertion tests only the row and column predecessors. A state at size \(m\) stores the open row width \(i-1\), the most recent ranks \(p_c\) in each column (zero if absent), and \(g_k\) for \(2\le k<t\), the number of cells since the last closed row of width at least \(k\). If there has been no such row set \(g_k=m\). Start empty with weight one. Add column \(i\) at rank \(q\in\{1,\ldots,m+1\}\) if \(q\le p_{i-1}\) when \(i>1\), and \(p_i=0\) or \(q\le p_i\). Set \(p'_i=q\), \(p'_c=p_c+\mathbf1_{\{p_c\ge q\}}\) for \(c\ne i\), and \(g'_k=g_k+1\); multiply the weight by one for \(i=1,2\), and by \(g_{i-1}\) otherwise. A row can close at any width \(i\ge1\) by resetting the gaps \(g'_k=0\) for \(k\le i\). Sum the closed-row weights at size \(n\). Since the replaced rank \(p_i\) does not affect the destination, group states by all other coordinates and use the suffix sum over old \(p_i\ge q\) plus the \(p_i=0\) entry. Through size \(N\) at fixed \(t\ge2\), the recurrence uses \(O_t(N^{2t-1})\) arithmetic operations and \(O_t(N^{2t-2})\) stored integers. It reduces the arithmetic exponent of Zhang's stated prefix-sum row algorithm by two. The boundary values are \(a_{t,0}=1\) and \(a_{1,n}=1\) for every \(n\ge0\). **Original problems** - Jerry Zhang, §6, sentence before Conjecture 6.1. For each fixed integer \(t\ge3\), is there a closed form or a simple recursive formulation for the number of permutations of \(0,\ldots,n\) ending in \(0\) that West's stack-sorting map sorts in at most \(t\) passes, for every \(n\ge0\)? The paper supplies the recursive alternative for all requested sizes and pass budgets. It grows Zhang's weighted tableaux one cell at a time and aggregates overwritten ranks with suffix sums. For fixed \(t\ge2\), all sizes through \(N\) take \(O_t(N^{2t-1})\) arithmetic operations and \(O_t(N^{2t-2})\) stored integers.
Authors
- Zixuan He
Institutions
- University of Glasgow (GB)
Publication Details
- Journal
- Zenodo (CERN European Organization for Nuclear Research)
- Published
- 2026-12-01
- DOI
- https://doi.org/10.5281/zenodo.24700732
- Primary Topic
- Advanced Combinatorial Mathematics
- Type
- preprint