---
title: Prime Parking Functions in Combinatorics
url: https://www.emergentmind.com/topics/prime-parking-functions
type: topic
---

# Prime Parking Functions in Combinatorics

Searching arXiv for recent papers on prime parking functions and related generalizations.
Prime parking functions are the indecomposable objects in the combinatorics of parking functions. In the classical one-way street model of Konheim and Weiss, a parking function of length $n$ is a sequence whose nondecreasing rearrangement $q_1\le \cdots \le q_n$ satisfies $q_i\le i$ for all $i$; it is prime when the stronger inequalities $q_i<i$ hold for all $i=2,\dots,n$, or equivalently when deleting a single entry equal to $1$ produces a parking function of length $n-1$ [2302.04210]. The same idea reappears in rooted trees, where primeness means that every edge is traversed by some displaced driver, and in broader settings such as vector, $(p,q)$, two-dimensional, and graphical parking functions, where primeness is defined by forbidding nontrivial decompositions [1804.01616] [2410.22232] [2506.23237].

## 1. Classical definition and indecomposability

A classical parking function of length $n$ is a sequence $p=(p_1,\dots,p_n)\in[n]^n$ such that every car parks under the forward-only parking rule. Equivalently, if $q_1\le \cdots \le q_n$ is the nondecreasing rearrangement of $p$, then
$$
q_i\le i \qquad (i=1,\dots,n).
$$
This criterion is standard in the subject and underlies most later generalizations [2302.04210].

A prime parking function is obtained by strengthening these inequalities. In one convention, a parking function $p\in \mathrm{PF}_n$ is prime if
$$
q_i<i \qquad (i=2,\dots,n).
$$
In the equivalent $0$-based convention used in generalized settings, a sequence ${a}=(a_0,\dots,a_{n-1})$ is prime if
$$
\bigl|\{\,j:a_j\le i\}\bigr|>i+1,\quad 0\le i\le n-2.
$$
The two formulations differ only by indexing. In both, primeness is characterized by strictness on every proper initial segment [2302.04210] [2410.22232].

Several equivalent descriptions are central. A classical parking function is prime if and only if removing one occurrence of $1$ yields a parking function of length $n-1$; in the $0$-based convention, the corresponding statement uses removal of a $0$ [2302.04210] [2410.22232]. Prime parking functions are also precisely those with no breakpoint except the final one: a breakpoint is an index $j<n$ such that exactly $j$ cars prefer spots in $[1,j]$, and its presence gives a decomposition into smaller parking functions. The absence of breakpoints therefore makes prime parking functions the indecomposable components of the classical theory [2506.23237].

Path models encode the same phenomenon. A parking function may be represented by a Catalan path, and any Catalan path factors uniquely as a concatenation of prime Catalan paths, namely those touching the diagonal only at start and end. Labeling the vertical steps yields a unique shuffle decomposition
$$
{a} \;=\; {a^{(1)}\oplus{a^{(2)}\oplus\cdots\oplus{a^{(k)},
$$
with each ${a^{(\ell)}}$ prime and $\sum_\ell n_\ell=n$ [2410.22232]. This makes primeness a direct combinatorial analogue of irreducibility under path concatenation.

## 2. Enumeration in the classical case

The basic enumerative formulas are classical:
$$
|\mathrm{PF}_n|=(n+1)^{\,n-1},
\qquad
|\mathrm{PF}'_n|=(n-1)^{\,n-1}.
$$
The second identity is the standard count of prime parking functions of length $n$ [2302.04210]. In the shifted notation of some later papers, the same statement is written as
$$
|\PPF_{n+1}|=n^n,
$$
which is equivalent after replacing $n$ by $n+1$ [2601.20770].

A direct combinatorial proof of
$$
\bigl|\mathrm{PF}'_n\bigr|=(n-1)^{n-1}
$$
was given by Duarte and Guedes de Oliveira through a bijection
$$
[\,n-1]^n \;\longleftrightarrow\; \bigl(\mathrm{PF}'_n\bigr)\times\{1,2,\dots,n-1\}.
$$
Starting from an arbitrary $a\in [n-1]^n$, they define cyclic sums
$$
s_i \;=\; \sum_{j=1}^{n-1} \Bigl(a_{\,i+j-1\;\bmod n}\;-\;a_{i-1\;\bmod n}\Bigr),
$$
choose
$$
d=\arg\min_{1\le i\le n}s_i,
\qquad
k=a_d,
$$
and then construct a shifted sequence
$$
b_i \;\equiv\; a_{\,d+i-1\;\bmod n}\;-\;(k-1)\pmod{n-1}.
$$
The resulting $b$ is prime, and the decomposition $(a)\mapsto (b,k)$ is unique, giving the enumeration immediately [2302.04210].

The same proof yields a parking-lot interpretation. If parking spots are labeled cyclically as
$$
k,\,k,\,k+1,\dots,n-1,\,1,2,\dots,k-1,
$$
then for every preference list $a=(a_1,\dots,a_n)$ with each $a_i\le n-1$ there is a unique entry point $k\in\{1,\dots,n-1\}$ such that all cars succeed; the corresponding shifted list is a prime parking function [2302.04210]. This reformulation places primeness close to the original parking rule rather than to an auxiliary recurrence or generating function.

## 3. Rooted-tree prime parking functions

King and Yan extended the notion of parking function from a line of parking spots to a rooted, vertex-labeled tree with all edges oriented toward the root. Drivers begin at preferred vertices and follow the unique directed path to the root until reaching the first vacant vertex. A preference sequence $s=(s_1,\dots,s_n)\in[n]^n$ is a parking function on a rooted tree $T$ if all drivers park [1804.01616].

The rooted-tree model has an exact subtree criterion. For each vertex $v$, let
$$
T_v=\{u:\text{there is a directed path }u\to\cdots\to v\}.
$$
Then
$$
s\text{ is a parking function on }T
\quad\Longleftrightarrow\quad
\forall\,v\in[n],\quad
|T_v|\le \bigl|\{\,i:s_i\in T_v\}\bigr|.
$$
The prime condition is obtained by making all proper down-set inequalities strict:
$$
(T,s)\text{ is prime}
\quad\Longleftrightarrow\quad
\forall\text{ non-root }v,\quad
|T_v|<\bigl|\{\,i:s_i\in T_v\}\bigr|.
$$
Equivalently, every non-root edge is used by some driver who fails to park at her preferred spot [1804.01616].

The main enumerative theorem is strikingly simple:
$$
P_n=(2n-2)!,
$$
where $P_n$ denotes the number of prime parking functions on rooted trees with $n$ vertices [1804.01616]. The proof is given both by generating functions and by bijection. On the generating-function side, if
$$
F(x)=\sum_{n\ge1}F_n\,\frac{x^n}{(n!)^2},
\qquad
P(x)=\sum_{n\ge1}P_n\,\frac{x^n}{(n!)^2},
$$
then decomposition into a prime core and adjunct components yields
$$
F(x)=P\bigl(x\,e^{F(x)}\bigr),
$$
and this combines with the explicit formula for $F(x)$ to imply
$$
P'(x)=C(x),
$$
where $C(x)$ is the Catalan generating function. Coefficient extraction gives $P_n=(2n-2)!$ [1804.01616].

The same paper introduces increasing prime tree parking functions, called prime parking distributions, obtained by imposing
$$
s_1\le s_2\le \cdots \le s_n.
$$
Their total number is
$$
\widetilde P_n=(n-1)!\,S_{n-1},
$$
where $S_k$ is the $k$th large Schröder number and
$$
\sum_{k\ge0}S_k\,x^k
=
\frac{1-x-\sqrt{1-6x+x^2}{2x}.
$$
The generating function satisfies the quadratic differential equation
$$
x\,\widetilde P'(x)^2+(x-1)\,\widetilde P'(x)+1=0,
$$
whose solution yields the Schröder-number formula [1804.01616].

## 4. Decomposition principles and bijective models

Prime parking functions are important partly because general parking functions decompose into them. In the rooted-tree setting, every parking function splits uniquely into a prime core together with ordinary parking functions hanging from unused edges. In one formulation, every parking function has a unique root-core: the maximal connected subtree containing the root whose every edge is used. Removing that core leaves attached subtrees, each carrying an ordinary tree parking function; conversely, gluing a prime core to arbitrary attached parking functions reconstructs the original object [1804.01616] [2007.14676].

This decomposition is structural rather than merely enumerative. In the notation of combinatorial classes, the total class $\mathcal G$ of parking functions and the prime class $\mathcal P$ satisfy a substitution equation of the form
$$
\mathcal G\cong \mathcal P\bigl(\mathcal Z,\phi(\mathcal G)\bigr),
$$
which becomes, at the level of generating functions,
$$
G(z)=P\bigl(z\,\Phi(G(z))\bigr).
$$
For Cayley trees, where $\Phi(t)=e^t$, Panholzer derives an implicit solution leading again to
$$
P_n=(2n-2)!,
$$
and extends the method to ordered, binary, $d$-ary, and bundled tree families [2007.14676].

Bijective approaches complement the generating-function theory. For rooted trees, there is a direct bijection
$$
\{\text{prime tree-parking functions on }n\text{ vertices}\}
\longleftrightarrow
\mathfrak S_n\times
\{\text{plane trees on $n$ vertices with non-root vertices labeled by }[n-1]\},
$$
which immediately yields
$$
n!\times (n-1)!\,C_{n-1}=(2n-2)!.
$$
The construction standardizes the parking procedure by recording the order in which edges are first crossed and then recursively peels off the final driver [1804.01616].

For classical parking functions, path bijections play an analogous role. A parking function $\pi$ corresponds to a Łukasiewicz word
$$
\ell_j=\#\{i:\pi_i=j\}-1
$$
and hence to a Łukasiewicz path that never dips below the axis. Prime parking functions correspond exactly to those paths that touch the axis only at the endpoints. There is also a bijection between labeled Łukasiewicz paths and labeled Dyck paths, and the area under the Łukasiewicz path equals the total displacement of the corresponding parking function [2601.20770]. This suggests that primeness is naturally encoded by a “no intermediate return” condition across multiple combinatorial realizations.

## 5. Statistics, displacement, and quasisymmetric structure

Recent work studies prime parking functions beyond counting. Harris, Kara, McNicholas, Nyman, and Yin define the total displacement of a prime parking function $\pi'$ of length $n+1$ by
$$
\disp(\pi')
\;=\;
\sum_{i=1}^{n+1}\bigl(p_i-\pi'_i\bigr)
\;=\;
\frac{(n+1)(n+2)}2-\sum_{i=1}^{n+1}\pi'_i,
$$
where $p_i$ is the actual parking spot attained by car $i$ [2601.20770].

They derive an exact formula for the displacement-enumerator
$$
\PPF_{n+1}(q):=\sum_{\pi'\in\PPF_{n+1}} q^{\disp(\pi')},
$$
namely
$$
\PPF_{n+1}(q)
=
(n+1)!\,q^n
\sum_{\substack{
(h_0,h_1,\dots,h_n)\text{ is}\\
\text{a Łukasiewicz height sequence}
}}
\frac1{\,h_1-h_0+2\,}
\prod_{j=1}^n
\frac{q^{\,h_j}}{(h_j-h_{j-1}+1)!},
$$
where $h_0=h_n=0$, $h_j\ge 0$, and $h_j-h_{j-1}\ge -1$ for each step [2601.20770]. They also compute
$$
E[\pi'_1]
=
\frac12\Bigl(n+3-\frac{n!}{n^n}\sum_{s=0}^n\frac{n^s}{s!}\Bigr),
$$
with a stated asymptotic expansion for $E[\pi'_1]$ and a corresponding asymptotic formula for $E[\disp(\pi')]$ [2601.20770].

Another refinement concerns local statistics modulo cyclic shift. For a tuple $x=(x_1,\dots,x_n)\in[n]^n$ and $\ell\in\{0,1,\dots,n-2\}$, an $\ell$-forward difference at position $i$ is defined by
$$
x_{i+1}-x_i\equiv \ell \pmod{n-1}.
$$
The case $\ell=0$ records ties. The generating polynomial for the number of $\ell$-forward differences is
$$
\sum_{\pi\in\PPF_n}q^{\,\#\{\text{$\ell$-forward differences of }\pi\}}
=(q+n-2)^{\,n-1}.
$$
By differentiation at $q=1$, the expected number of $\ell$-forward differences is $1$ for every fixed $\ell$; in particular, the expected number of ties in a uniform prime parking function is $1$, and the expected numbers of strict ascents and descents are each $(n-2)/2$ [2601.20770].

Prime parking functions also support quasisymmetric and Schur-positive expansions. Writing $F_{n,S}$ for Gessel’s fundamental quasisymmetric function and $\Tie(\pi)$ for the tie set of $\pi$, one has
$$
\sum_{\pi\in\PPF_n}F_{n,\Tie(\pi)}
=
\sum_{i=1}^n (n-2)^{\,i-1}\;s_{(\,i,1^{\,n-i}\!)},
$$
where $s_{(i,1^{n-i})}$ is the Schur function of hook shape $(i,1^{n-i})$ [2601.20770]. This places prime parking functions within the algebraic combinatorics of $P$-partitions and symmetric-function expansions.

## 6. Generalized and graphical prime parking functions

The indecomposability paradigm extends well beyond the classical line and rooted-tree models. Armon, Le Borgne, and Vazirani define primeness for vector parking functions, $(p,q)$-parking functions, and two-dimensional vector parking functions by replacing weak inequalities with strict ones on proper initial data, or equivalently by requiring the underlying path model to touch its boundary only at the start and end [2410.22232].

For a weakly increasing vector ${u}=(u_0\le \cdots \le u_{n-1})$, a $u$-parking function ${a}$ is prime when
$$
\bigl|\{\,j:a_j<u_i\}\bigr|>i+1,\quad 0\le i\le n-2.
$$
Equivalently, ${a}$ is prime for $u$ if and only if it is an ordinary $u'$-parking function for
$$
u'=(u_0,u_0,u_1,\dots,u_{n-2}).
$$
When $u_i=a+bi$ is an arithmetic progression, the paper gives explicit formulas:
$$
\#IPPF_n\bigl(a,a+b,\dots,a+b(n-1)\bigr)
=\frac{a-b}{n}\binom{a+(b+1)(n-1)}{n-1}
+\frac{b}{n}\binom{(b+1)(n-1)}{n-1},
$$
and
$$
\#PPF_n\bigl(a,a+b,\dots,a+b(n-1)\bigr)
=(a-b)\bigl[a+(n-1)b\bigr]^{\,n-1}+b^n\,(n-1)^{\,n-1}.
$$
The special case $a=b=1$ recovers the classical count $(n-1)^{n-1}$ [2410.22232].

For prime $(p,q)$-parking functions, the defining condition is that the two order-statistic lattice paths intersect only at $(0,0)$ and $(p,q)$. Equivalently, removing a zero from each of the two sequences produces an ordinary $(p-1,q-1)$-parking function. Their total number is
$$
\#PPF(p,q)
=
p^q\,(q-1)^{\,p-1}
+
q^p\,(p-1)^{\,q-1}
-
(p+q-1)\,(p-1)^{\,q-1}(q-1)^{\,p-1},
$$
while the increasing ones satisfy
$$
\#IPPF(p,q)
=
\frac{1}{p+q-1}\binom{p+q-1}{p-1}\binom{p+q-1}{q-1}.
$$
The degeneration $p=0$ or $q=0$ yields the classical prime enumeration [2410.22232].

Graphical generalizations replace the line or lattice path by an arbitrary connected graph with a sink. A $G$-parking function is prime if it admits no nontrivial decomposition across a partition $(A,B)$ of the nonsink vertices; in one-dimensional and bipartite specializations this recovers the classical and $(p,q)$ notions [2506.23237]. Under the Postnikov–Shapiro correspondence
$$
p\mapsto \deg-p,
$$
$G$-parking functions are in bijection with recurrent configurations of the Abelian sandpile model, and prime $G$-parking functions correspond to strongly recurrent configurations [2506.23237]. This duality yields explicit counts on several graph families, including wheel graphs, complete graphs, complete multi-partite graphs, complete bipartite graphs with dominating sink, and complete split graphs [2506.23237].

A notable difference from the classical case appears here: every $p\in \mathrm{PF}(G)$ admits a prime decomposition into blocks, but unlike the classical line-graph case this decomposition need not be unique in general [2506.23237]. This suggests that “prime” retains its role as an indecomposable unit, while uniqueness of factorization is sensitive to the ambient combinatorial geometry of the parking model.

Source: https://www.emergentmind.com/topics/prime-parking-functions