Continued fractions for cycle-alternating permutations

Bishal Deb¹,² and Alan D. Sokal¹,³

¹Department of Mathematics, University College London, London WC1E 6BT, UK

²Sorbonne Université and Université Paris Cité, CNRS, Laboratoire de Probabilités, Statistique et Modélisation, Paris, France

³Department of Physics, New York University, New York, NY 10003, USA

bishal@gonitsora.com, sokal@nyu.edu

April 13, 2023

Revised April 2, 2024

**Abstract**

A permutation is said to be cycle-alternating if it has no cycle double rises, cycle double falls or fixed points; thus each index $i$ is either a cycle valley ($\sigma^{-1}(i) > i < \sigma(i)$) or a cycle peak ($\sigma^{-1}(i) < i > \sigma(i)$). We find Stieltjes-type continued fractions for some multivariate polynomials that enumerate cycle-alternating permutations with respect to a large (sometimes infinite) number of simultaneous statistics that measure cycle status, record status, crossings and nestings along with the parity of the indices. Our continued fractions are specializations of more general continued fractions of Sokal and Zeng. We then introduce alternating Laguerre digraphs, which are generalization of cycle-alternating permutations, and find exponential generating functions for some polynomials enumerating them. We interpret the Stieltjes-Rogers and Jacobi-Rogers matrices associated to some of our continued fractions in terms of alternating Laguerre digraphs.

**Key Words:** Permutation, cycle-alternating permutation, alternating cycle, Laguerre digraph, alternating Laguerre digraph, secant numbers, tangent numbers, continued fraction, S-fraction, Dyck path.

**Mathematics Subject Classification (MSC 2020) codes:** 05A19 (Primary); 05A05, 05A15, 05A30, 11B68, 30B70 (Secondary).
# Contents

<table><tr><td>1</td><td>Introduction</td><td>3</td></tr><tr><td>2</td><td>Preliminaries: Continued fractions</td><td>6</td></tr><tr><td>2.1</td><td>Motzkin and Dyck paths</td><td>7</td></tr><tr><td>2.2</td><td>J-fractions and Jacobi–Rogers polynomials</td><td>7</td></tr><tr><td>2.3</td><td>S-fractions and Stieltjes–Rogers polynomials</td><td>9</td></tr><tr><td>3</td><td>Preliminaries: Permutation statistics</td><td>10</td></tr><tr><td>3.1</td><td>The record-and-cycle classification.</td><td>10</td></tr><tr><td>3.2</td><td>Crossings and nestings</td><td>12</td></tr><tr><td>4</td><td>First S-fraction for cycle-alternating permutations</td><td>16</td></tr><tr><td>4.1</td><td>First S-fraction (8 variables)</td><td>16</td></tr><tr><td>4.2</td><td>p, q-generalization of first S-fraction (16 variables)</td><td>20</td></tr><tr><td>5</td><td>Second S-fraction for cycle-alternating permutations</td><td>22</td></tr><tr><td>5.1</td><td>Second S-fraction (counting of cycles)</td><td>22</td></tr><tr><td>5.2</td><td>p, q-generalization of second S-fraction</td><td>23</td></tr><tr><td>5.3</td><td>Alternating cycles.</td><td>25</td></tr><tr><td>5.4</td><td>Open problem: Combinatorial model for the tangent numbers</td><td>26</td></tr><tr><td>6</td><td>Alternating Laguerre digraphs</td><td>27</td></tr><tr><td>6.1</td><td>Exponential generating function for Laguerre digraphs</td><td>28</td></tr><tr><td>6.2</td><td>Alternating Laguerre digraphs</td><td>31</td></tr><tr><td>6.3</td><td>Continued fraction for secant power polynomials</td><td>32</td></tr><tr><td>6.4</td><td>Generalized Stieltjes–Rogers polynomials for the second master S-fraction</td><td>33</td></tr><tr><td>6.5</td><td>Specialization to the case of Theorems 5.1 and 5.2</td><td>37</td></tr><tr><td colspan="2">Acknowledgments</td><td>42</td></tr><tr><td>A</td><td>Nonexistence of J-fractions with polynomial coefficients</td><td>42</td></tr><tr><td>A.1</td><td>J-fraction for the polynomials (5.2)</td><td>42</td></tr><tr><td>A.2</td><td>J-fraction for the polynomials (5.2) restricted to alternating cycles</td><td>44</td></tr><tr><td colspan="2">Bibliography</td><td>44</td></tr></table>
# 1 Introduction

A permutation $\sigma$ is called *cycle-alternating* if it has no cycle double rises, cycle double falls, or fixed points; thus, each cycle of $\sigma$ is of even length (call it $2m$) and consists of $m$ cycle valleys and $m$ cycle peaks in alternation.<fnref n="1" /> Deutsch and Elizalde [5, Proposition 2.2] showed that the number of cycle-alternating permutations of $[2n]$ is the secant number $E_{2n}$ (see also Dumont [11, pp. 37, 40] and Biane [1, section 6]). In this paper we would like to present some new continued fractions for multivariate polynomials that enumerate cycle-alternating permutations with respect to a large set of statistics (8 or 16 variables).

But first it may be appropriate to place this project in a wider context. In a recent article [31], Zeng and one of us presented Stieltjes-type and Jacobi-type continued fractions for some “master polynomials” that enumerate permutations, set partitions or perfect matchings with respect to a large (sometimes infinite) number of independent statistics. These polynomials systematize what we think of as the “linear family”: namely, sequences in which the Stieltjes continued-fraction coefficients $(\alpha_n)_{n \ge 1}$ grow linearly in $n$. For instance, Euler [13, section 21] showed in 1746 that

$$ \sum_{n=0}^{\infty} n! t^n = \frac{1}{1 - \frac{1t}{1 - \frac{1t}{1 - \frac{2t}{1 - \frac{2t}{1 - \dots}}}}} \quad (1.1) $$

In other words, the ordinary generating function (ogf) of the sequence $a_n = n!$ has a Stieltjes-type continued fraction with coefficients $\alpha_{2k-1} = \alpha_{2k} = k$. This inspired us to introduce the polynomials $P_n(x, y, u, v)$ defined by the continued fraction

$$ \sum_{n=0}^{\infty} P_n(x, y, u, v) t^n = \frac{1}{1 - \frac{xt}{1 - \frac{yt}{1 - \frac{(x+u)t}{1 - \frac{(y+v)t}{1 - \frac{(x+2u)t}{1 - \frac{(y+2v)t}{1 - \dots}}}}}}} \quad (1.2) $$

with coefficients

$$ \alpha_{2k-1} = x + (k-1)u \quad (1.3a) $$

$$ \alpha_{2k} = y + (k-1)v \quad (1.3b) $$

<footnote n="1">¹**Warning:** The phrase “cycle-alternating permutations” has previously been used by Josuat-Vergès in [19] to describe a different class of objects. We think that his objects should instead be called cycle-alternating *signed* permutations.</footnote>
Clearly $P_n(x, y, u, v)$ is a homogeneous polynomial of degree $n$, with nonnegative integer coefficients; and since $P_n(1, 1, 1, 1) = n!$, which enumerates permutations of an $n$-element set, it was plausible to expect that $P_n(x, y, u, v)$ enumerates permutations of $[n]$ according to some natural fourfold classification of indices in $[n]$. Our first theorem [31, Theorem 2.1] provided two alternative versions of that classification.

But there are other sequences of integers, and hence other combinatorial models, that also belong to the “linear family”. For instance, in that same paper Euler also showed [13, section 29] (see also [14]) that the generating function of the odd semifactorials can be represented as a Stieltjes-type continued fraction

$$ \sum_{n=0}^{\infty} (2n-1)!! t^n = \frac{1}{1 - \frac{1t}{1 - \frac{2t}{1 - \frac{3t}{1 - \dots}}}} \quad (1.4) $$

with coefficients $\alpha_n = n$. Inspired by (1.4), we introduced the polynomials $M_n(x, y, u, v)$ defined by the continued fraction

$$ \sum_{n=0}^{\infty} M_n(x, y, u, v) t^n = \frac{1}{1 - \frac{xt}{1 - \frac{(y+v)t}{1 - \frac{(x+2u)t}{1 - \frac{(y+3v)t}{1 - \frac{(x+4u)t}{1 - \frac{(y+5v)t}{1 - \dots}}}}}}} \quad (1.5) $$

with coefficients

$$ \alpha_{2k-1} = x + (2k-2)u \quad (1.6a) $$

$$ \alpha_{2k} = y + (2k-1)v \quad (1.6b) $$

Clearly $M_n(x, y, u, v)$ is a homogeneous polynomial of degree $n$, with nonnegative integer coefficients; and since $M_n(1, 1, 1, 1) = (2n-1)!!$, which enumerates perfect matchings of a $2n$-element set, it was plausible to expect that $M_n(x, y, u, v)$ enumerates perfect matchings of $[2n]$ (or equivalently, fixed-point-free involutions of $[2n]$) according to some natural fourfold classification associated to half of the indices in $[2n]$. In [31, Theorem 4.1] we identified such a classification, involving even and odd cycle peaks and their antirecord status.

In a very recent paper [3], the two present authors took one step up in complexity, to consider the “quadratic family”, in which the $(\alpha_n)_{n \ge 1}$ grow quadratically in $n$. For instance, we could consider

$$ \alpha_{2k-1} = [x_1 + (k-1)u_1] [x_2 + (k-1)u_2] \quad (1.7a) $$

$$ \alpha_{2k} = [y_1 + (k-1)v_1] [y_2 + (k-1)v_2] \quad (1.7b) $$
which can be thought of as the product of two independent sets of coefficients (1.3). With all parameters set to 1, these coefficients $\alpha_{2k-1} = \alpha_{2k} = k^2$ correspond to the continued fraction [35, eq. (9.7)] [36, p. V-15] for the median Genocchi numbers [23, A005439]; so it was natural to seek a combinatorial model that is enumerated by the median Genocchi numbers. In [3] we considered D-permutations [20, 21] and various subclasses thereof (D-semiderangements and D-derangements), and found Stieltjes-type and Thron-type continued fractions for some multivariate polynomials enumerating these objects with respect to a large set of statistics (12 or 22 variables).

But just as with the “linear family”, there are other sequences of integers, and hence other combinatorial models, that also belong to the “quadratic family”. For instance, the secant numbers $E_{2n}$ [23, A000364] can be represented by the continued fraction [34, p. H9] [26, p. 77] [15, Theorem 3B(iii)]

$$ \sum_{n=0}^{\infty} E_{2n} t^n = \frac{1}{1 - \frac{1^2 t}{1 - \frac{2^2 t}{1 - \frac{3^2 t}{1 - \dots}}}} \quad (1.8) $$

with coefficients $\alpha_n = n^2$. In [31, Section 2.15] this was generalized by introducing the polynomials $Q_n(x, y, u, v)$ whose ogf has an S-fraction with coefficients $\alpha_n = [x+(n-1)u][y+(n-1)v]$, and they were interpreted as enumerating cycle-alternating permutations of $[2n]$ according to the antirecord status of cycle peaks and the record status of cycle valleys.

In the present paper we shall go farther, and introduce polynomials $Q_n(x', y', u', v', x'', y'', u'', v'')$ whose ogf has an S-fraction with coefficients

$$ \alpha_{2k-1} = [x' + (2k-2)u'] [y' + (2k-2)v'] \quad (1.9a) $$

$$ \alpha_{2k} = [x'' + (2k-1)u''] [y'' + (2k-1)v''] \quad (1.9b) $$

which can be thought of as the product of two independent sets of coefficients (1.6). When $x' = x'', y' = y'', u' = u'', v' = v''$ this reduces to the previous polynomials. We will interpret these 8-variable polynomials as enumerating cycle-alternating permutations of $[2n]$ according to the antirecord status of cycle peaks and the record status of cycle valleys, separately for even and odd indices (Theorem 4.1).<fnref n="2" /> We will also obtain a generalization of this result to 16-variable polynomials that include four pairs of variables $(p, q)$ that count crossings and nestings (Theorem 4.4). The proofs will in fact be easy applications of the “master” S-fraction for cycle-alternating permutations [31, Theorem 2.20]. Finally, we will obtain variants that include the counting of cycles, at the expense of renouncing taking account of the record status of cycle valleys (Theorems 5.1 and 5.2).

This leaves us with the following analogy between the linear and quadratic families:

<footnote n="2">²This answers the question posed in [31, last sentence of Section 2.15].</footnote>
“Linear family”:

Permutations
$\alpha_{2k-1} = \alpha_{2k} = k$
Generalized to (1.3)

Perfect matchings
$\alpha_n = n$
Generalized to (1.6)

<figure><img src="image_1.png" /></figure>

<figure><img src="image_2.png" /></figure>

“Quadratic family”:

D-permutations
$\alpha_{2k-1} = \alpha_{2k} = k^2$
Generalized to (1.7)

Cycle-alternating permutations
$\alpha_n = n^2$
Generalized to (1.9)

The only slight flaw in the analogy is that the permutations are on $[n]$, while the other three models are on $[2n]$.

This suggests to pursue the analogy one step further: the third combinatorial model in the “linear family” is set partitions, with $a_n = B_n$ (Bell number) and $\alpha_{2k-1} = 1$, $\alpha_{2k} = k$. The corresponding member of the “quadratic family” would have $\alpha_{2k-1} = 1$, $\alpha_{2k} = k^2$, which leads to the sequence

$$ (a_n)_{n \ge 0} = 1, 1, 2, 5, 17, 78, 461, 3417, 31134, 340217, 4365673, \dots \quad (1.10) $$

Alas, this sequence is not at present in the OEIS [23], and we have no idea what combinatorial model it might represent.

We can, in fact, place our results on cycle-alternating permutations in a wider context: namely, that of Laguerre digraphs. A **Laguerre digraph** [2, 17, 29] is a digraph in which each vertex has out-degree 0 or 1 and in-degree 0 or 1. Therefore, each weakly connected component of a Laguerre digraph is either a directed path of some length $\ell \ge 0$ (where a path of length 0 is an isolated vertex) or else a directed cycle of some length $\ell \ge 1$ (where a cycle of length 1 is a loop). A Laguerre digraph with no paths is simply a collection of directed cycles, i.e. the digraph associated to a permutation; so Laguerre digraphs generalize permutations. We shall then define a subclass of Laguerre digraphs, called **alternating Laguerre digraphs**, that similarly generalizes cycle-alternating permutations. We shall show that the generalized Stieltjes–Rogers polynomials associated to the cycle-counting variant of the S-fraction (1.9), as well as its generalizations, can be interpreted as enumerating alternating Laguerre digraphs with suitable weights.

The plan of this paper is as follows: In Sections 2 and 3 we review some needed definitions and facts concerning continued fractions and permutation statistics, respectively. In Section 4 we state and prove our “first” S-fractions for cycle-alternating permutations (namely, the ones not including the counting of cycles); and in Section 5 we do the same for our “second” S-fractions (namely, those including the counting of cycles). In Section 6 we put cycle-alternating permutations into the wider context of alternating Laguerre digraphs, and then use this to interpret the generalized Stieltjes–Rogers polynomials associated to some of our continued fractions.

# 2 Preliminaries: Continued fractions

In this section we define the objects associated to continued fractions that will be used in the remainder of the paper, and review some of their properties.
## 2.1 Motzkin and Dyck paths

A Motzkin path is a path in the upper half-plane $\mathbb{Z} \times \mathbb{N}$, starting and ending on the horizontal axis, using the steps (1, 1) [“rise”], (1, 0) [“level step”] and (1, -1) [“fall”]. More generally, a partial Motzkin path is a path in the upper half-plane $\mathbb{Z} \times \mathbb{N}$, starting on the horizontal axis but ending anywhere, using the steps (1, 1), (1, 0) and (1, -1).

A Dyck path is a path in the upper half-plane $\mathbb{Z} \times \mathbb{N}$, starting and ending on the horizontal axis, using the steps (1, 1) [“rise”] and (1, -1) [“fall”]; that is, it is a Motzkin path that has no level steps. Obviously a Dyck path must have even length. More generally, a partial Dyck path is a path in the upper half-plane $\mathbb{Z} \times \mathbb{N}$, starting on the horizontal axis but ending anywhere, using the steps (1, 1) and (1, -1).

We shall usually take all these paths to start at the origin (0, 0). Then any partial Dyck path must stay on the even sublattice $\{(n, k) : n + k$ is even\}$.

## 2.2 J-fractions and Jacobi–Rogers polynomials

Let $\beta = (\beta_i)_{i \ge 1}$ and $\gamma = (\gamma_i)_{i \ge 0}$ be indeterminates. Following Flajolet [15], we define the Jacobi–Rogers polynomials $J_n(\beta, \gamma)$ to be the Taylor coefficients of the generic J-fraction:

$$ \sum_{n=0}^{\infty} J_n(\beta, \gamma) t^n = \frac{1}{1 - \gamma_0 t - \frac{\beta_1 t^2}{1 - \gamma_1 t - \frac{\beta_2 t^2}{1 - \dots}}} \quad (2.1) $$

Clearly $J_n(\beta, \gamma)$ is a polynomial in $\beta$ and $\gamma$, with nonnegative integer coefficients. Flajolet [15] showed that the Jacobi–Rogers polynomial $J_n(\beta, \gamma)$ is the generating polynomial for Motzkin paths of length $n$, in which each rise gets weight 1, each fall from height $i$ gets weight $\beta_i$, and each level step at height $i$ gets weight $\gamma_i$.

Now define the generalized Jacobi–Rogers polynomial $J_{n,k}(\beta, \gamma)$ to be the generating polynomial for partial Motzkin paths from (0, 0) to (n, k), in which each rise gets weight 1, each fall from height $i$ gets weight $\beta_i$, and each level step at height $i$ gets weight $\gamma_i$. Obviously $J_{n,k}$ is nonvanishing only for $0 \le k \le n$, so we have an infinite lower-triangular array $J = (J_{n,k}(\beta, \gamma))_{n,k \ge 0}$ in which the zeroth column displays the ordinary Jacobi–Rogers polynomials $J_{n,0} = J_n$. On the diagonal we have $J_{n,n} = 1$, and on the first subdiagonal we have $J_{n,n-1} = \sum_{i=0}^{n-1} \gamma_i$. By considering the last step of the path, we see that the polynomials $J_{n,k}(\beta, \gamma)$ satisfy the recurrence

$$ J_{n+1,k} = J_{n,k-1} + \gamma_k J_{n,k} + \beta_{k+1} J_{n,k+1} \quad (2.2) $$

with the initial condition $J_{0,k} = \delta_{k0}$ (where of course we set $J_{n,-1} = 0$).

A redundant generalization of these polynomials, in which we also weight rises in the Motzkin path, will be useful later. Let $\mathbf{a} = (\mathbf{a}_i)_{i \ge 0}$, $\mathbf{b} = (\mathbf{b}_i)_{i \ge 1}$ and $\mathbf{c} = (\mathbf{c}_i)_{i \ge 0}$ be indeterminates. Define $J_{n,k}(\mathbf{a}, \mathbf{b}, \mathbf{c})$ to be the generating polynomial for partial Motzkin paths from (0, 0) to (n, k), in which each rise from height $i$ gets weight $\mathbf{a}_i$, each fall from height $i$ gets weight $\mathbf{b}_i$, and each level step at height $i$ gets weight $\mathbf{c}_i$.
By considering the last step of the path, we see that these polynomials satisfy the recurrence

$$J_{n+1,k} = a_{k-1}J_{n,k-1} + c_k J_{n,k} + b_{k+1}J_{n,k+1}. \quad (2.3)$$

The recurrences (2.2) and (2.3) then easily imply the following proposition:

**Proposition 2.1.** The polynomials $J_{n,k}(\mathbf{a}, \mathbf{b}, \mathbf{c})$ are related to the polynomials $J_{n,k}(\boldsymbol{\beta}, \boldsymbol{\gamma})$ with weights

$$\beta_n = a_{n-1}b_n \quad (2.4a)$$

$$\gamma_n = c_n \quad (2.4b)$$

by

$$J_{n,k}(\mathbf{a}, \mathbf{b}, \mathbf{c}) = \left( \prod_{i=0}^{k-1} a_i \right) J_{n,k}(\boldsymbol{\beta}, \boldsymbol{\gamma}). \quad (2.5)$$

We remark that since $J_{n,k}(\boldsymbol{\beta}, \boldsymbol{\gamma})$ is by definition a polynomial, it follows that the polynomial $J_{n,k}(\mathbf{a}, \mathbf{b}, \mathbf{c})$ necessarily has a factor $\prod_{i=0}^{k-1} a_i$, and that $J_{n,k}(\boldsymbol{\beta}, \boldsymbol{\gamma}) = J_{n,k}(\mathbf{a}, \mathbf{b}, \mathbf{c}) / \prod_{i=0}^{k-1} a_i$.

**PROOF.** Let us use the shorthands $J_{n,k} = J_{n,k}(\boldsymbol{\beta}, \boldsymbol{\gamma})$ and $J'_{n,k} = J_{n,k}(\mathbf{a}, \mathbf{b}, \mathbf{c})$; and define $p_k = \prod_{i=0}^{k-1} a_i$. The recurrence (2.2), with weights (2.4), is

$$J_{n+1,k} = J_{n,k-1} + c_k J_{n,k} + a_k b_{k+1} J_{n,k+1}. \quad (2.6)$$

Multiplying both sides of (2.6) with $p_k$ yields

$$J_{n+1,k} p_k = p_k (J_{n,k-1} + c_k J_{n,k} + a_k b_{k+1} J_{n,k+1}) \quad (2.7a)$$

$$= a_{k-1} (J_{n,k-1} p_{k-1}) + c_k (J_{n,k} p_k) + b_{k+1} (J_{n,k+1} p_{k+1}) \quad (2.7b)$$

Comparing the coefficients in (2.7b) and (2.3), we notice that the recurrences for the polynomials $J_{n,k} p_k$ and $J'_{n,k}$ are exactly the same; and of course the initial conditions are the same as well. This shows that $J'_{n,k} = J_{n,k} p_k$, as claimed in (2.5). $\square$

One important algebraic tool for studying J-fractions is **Rogers' addition formula** [26] [37, Theorem 53.1], which we state in the form given in [30, Theorem 9.9]:

**Theorem 2.2 (Rogers' addition formula).** The column exponential generating functions of the matrix of generalized Jacobi-Rogers polynomials,

$$\mathcal{J}_k(t; \boldsymbol{\beta}, \boldsymbol{\gamma}) \stackrel{\text{def}}{=} \sum_{n=k}^{\infty} J_{n,k}(\boldsymbol{\beta}, \boldsymbol{\gamma}) \frac{t^n}{n!}, \quad (2.8)$$

satisfy

$$\mathcal{J}_0(t+u; \boldsymbol{\beta}, \boldsymbol{\gamma}) = \sum_{k=0}^{\infty} \beta_1 \cdots \beta_k \mathcal{J}_k(t; \boldsymbol{\beta}, \boldsymbol{\gamma}) \mathcal{J}_k(u; \boldsymbol{\beta}, \boldsymbol{\gamma}). \quad (2.9)$$
And conversely, if $A(t)$ and $F_0(t)$, $F_1(t)$, ... are formal power series (with elements in a commutative ring $R$ containing the rationals) satisfying

$$A(t) = 1 + O(t), \quad F_k(t) = \frac{t^k}{k!} + \mu_k \frac{t^{k+1}}{(k+1)!} + O(t^{k+2}) \quad (2.10)$$

and

$$A(t+u) = \sum_{k=0}^{\infty} \beta_1 \cdots \beta_k F_k(t) F_k(u) \quad (2.11)$$

for some regular elements $\beta = (\beta_k)_{k \ge 1}$, then $A(t) = F_0(t)$ and $F_k(t) = J_k(t; \beta, \gamma)$ with the given $\beta$ and with $\gamma_k = \mu_k - \mu_{k-1}$ (where $\mu_{-1} \stackrel{\text{def}}{=} 0$).

Here an element of a commutative ring $R$ is called **regular** if it is neither zero nor a divisor of zero.

## 2.3 S-fractions and Stieltjes–Rogers polynomials

Let $\alpha = (\alpha_i)_{i \ge 1}$ be indeterminates. Again following Flajolet [15], we define the **Stieltjes–Rogers polynomials** $S_n(\alpha)$ to be the Taylor coefficients of the generic S-fraction:

$$\sum_{n=0}^{\infty} S_n(\alpha) t^n = \frac{1}{1 - \frac{\alpha_1 t}{1 - \frac{\alpha_2 t}{1 - \dots}}} \quad (2.12)$$

Clearly $S_n(\alpha)$ is a homogeneous polynomial of degree $n$ in $\alpha$, with nonnegative integer coefficients. Flajolet [15] showed that the Stieltjes–Rogers polynomial $S_n(\alpha)$ is the generating polynomial for Dyck paths of length $2n$, in which each rise gets weight 1 and each fall from height $i$ gets weight $\alpha_i$.

Now define the **generalized Stieltjes–Rogers polynomial of the first kind** $S_{n,k}(\alpha)$ to be the generating polynomial for Dyck paths starting at (0,0) and ending at $(2n, 2k)$, in which each rise gets weight 1 and each fall from height $i$ gets weight $\alpha_i$. Obviously $S_{n,k}$ is nonvanishing only for $0 \le k \le n$, so we have an infinite lower-triangular array $S = (S_{n,k}(\alpha))_{n,k \ge 0}$ in which the zeroth column displays the ordinary Stieltjes–Rogers polynomials $S_{n,0} = S_n$. We have $S_{n,n} = 1$ and $S_{n,n-1} = \sum_{i=1}^{2n-1} \alpha_i$.

Likewise, let us define the **generalized Stieltjes–Rogers polynomial of the second kind** $S'_{n,k}(\alpha)$ to be the generating polynomial for Dyck paths starting at (0,0) and ending at $(2n+1, 2k+1)$, in which again each rise gets weight 1 and each fall from height $i$ gets weight $\alpha_i$. Since $S'_{n,k}$ is nonvanishing only for $0 \le k \le n$, we obtain a second infinite lower-triangular array $S' = (S'_{n,k}(\alpha))_{n,k \ge 0}$. We have $S'_{n,n} = 1$ and $S'_{n,n-1} = \sum_{i=1}^{2n} \alpha_i$.

The polynomials $S_{n,k}(\alpha)$ and $S'_{n,k}(\alpha)$ manifestly satisfy the joint recurrence

$$S'_{n,k} = S_{n,k} + \alpha_{2k+2} S_{n,k+1} \quad (2.13a)$$

$$S_{n+1,k} = S'_{n,k-1} + \alpha_{2k+1} S'_{n,k} \quad (2.13b)$$

for $n, k \ge 0$, with the initial conditions $S_{0,k} = \delta_{k0}$ and $S'_{n,-1} = 0$. It follows that the $S_{n,k}$ satisfy the recurrence

$$S_{n+1,k} = S_{n,k-1} + (\alpha_{2k} + \alpha_{2k+1}) S_{n,k} + \alpha_{2k+1}\alpha_{2k+2} S_{n,k+1} \quad (2.14)$$
(where $S_{n,-1} = 0$ and $\alpha_0 = 0$), while the $S'_{n,k}$ satisfy the recurrence

$$S'_{n+1,k} = S'_{n,k-1} + (\alpha_{2k+1} + \alpha_{2k+2}) S'_{n,k} + \alpha_{2k+2}\alpha_{2k+3} S'_{n,k+1}. \quad (2.15)$$

Note that (2.14) and (2.15) have the same form as (2.2), when $\beta$ and $\gamma$ are defined suitably in terms of the $\alpha$: these correspondences are examples of **contraction formulae** [37, p. 21] [36, p. V-31] that express an S-fraction as an equivalent J-fraction. In particular we have $S_{n,k}(\alpha) = J_{n,k}(\beta, \gamma)$ where

$$\gamma_0 = \alpha_1 \quad (2.16a)$$

$$\gamma_n = \alpha_{2n} + \alpha_{2n+1} \quad \text{for } n \ge 1 \quad (2.16b)$$

$$\beta_n = \alpha_{2n-1}\alpha_{2n} \quad (2.16c)$$

and $S'_{n,k}(\alpha) = J_{n,k}(\beta', \gamma')$ where

$$\gamma'_n = \alpha_{2n+1} + \alpha_{2n+2} \quad (2.17a)$$

$$\beta'_n = \alpha_{2n}\alpha_{2n+1} \quad (2.17b)$$

The recurrences (2.2)/(2.14)/(2.15) define implicitly the (tridiagonal) **production matrices** for J, S and S': see [6, 7, 24]. Some workers call the arrays J, S and/or S' the **Stieltjes table**.

More trivially, a partial Dyck path is simply a partial Motzkin path with no level steps. Therefore, the generalized Stieltjes–Rogers polynomials with weights $\alpha$ can be related to the generalized Jacobi–Rogers polynomials with weights $(\beta, \gamma) = (\alpha, 0)$ by

$$S_{n,k}(\alpha) = J_{2n,2k}(\alpha, 0) \quad (2.18a)$$

$$S'_{n,k}(\alpha) = J_{2n+1,2k+1}(\alpha, 0) \quad (2.18b)$$

and

$$J_{n,k}(\alpha, 0) = 0 \quad \text{if } n + k \text{ is odd}. \quad (2.19)$$

# 3 Preliminaries: Permutation statistics

In this section we define the permutation statistics that will be used in the remainder of the paper.

## 3.1 The record-and-cycle classification

Given a permutation $\sigma \in \mathfrak{S}_N$, an index $i \in [N]$ is called an

* *excedance* (exc) if $i < \sigma(i)$;

* *anti-excedance* (aexc) if $i > \sigma(i)$;

* *fixed point* (fix) if $i = \sigma(i)$.

Clearly every index $i$ belongs to exactly one of these three types; we call this the *excedance classification*. We also say that $i$ is a *weak excedance* if $i \le \sigma(i)$, and a *weak anti-excedance* if $i \ge \sigma(i)$.

A more refined classification is as follows: an index $i \in [N]$ is called a
* cycle peak (cpeak) if $\sigma^{-1}(i) < i > \sigma(i)$;

* cycle valley (cval) if $\sigma^{-1}(i) > i < \sigma(i)$;

* cycle double rise (cdrise) if $\sigma^{-1}(i) < i < \sigma(i)$;

* cycle double fall (cdfall) if $\sigma^{-1}(i) > i > \sigma(i)$;

* fixed point (fix) if $\sigma^{-1}(i) = i = \sigma(i)$.

Clearly every index $i$ belongs to exactly one of these five types; we refer to this classification as the **cycle classification**. Obviously, excedance = cycle valley or cycle double rise, and anti-excedance = cycle peak or cycle double fall. We write

$$Cpeak(\sigma) = \{i: \sigma^{-1}(i) < i > \sigma(i)\} \qquad (3.1)$$

for the set of cycle peaks and

$$cpeak(\sigma) = |Cpeak(\sigma)| \qquad (3.2)$$

for its cardinality, and likewise for the others.

On the other hand, an index $i \in [N]$ is called a

* record (rec) (or left-to-right maximum) if $\sigma(j) < \sigma(i)$ for all $j < i$ [note in particular that the indices 1 and $\sigma^{-1}(N)$ are always records];

* antirecord (arec) (or right-to-left minimum) if $\sigma(j) > \sigma(i)$ for all $j > i$ [note in particular that the indices $N$ and $\sigma^{-1}(1)$ are always antirecords];

* exclusive record (erec) if it is a record and not also an antirecord;

* exclusive antirecord (earec) if it is an antirecord and not also a record;

* record-antirecord (rar) (or pivot) if it is both a record and an antirecord;

* neither-record-antirecord (nrar) if it is neither a record nor an antirecord.

Every index $i$ thus belongs to exactly one of the latter four types; we refer to this classification as the **record classification**. We write

$$\mathrm{Rec}(\sigma) = \{i: \sigma(j) < \sigma(i) \text{ for all } j < i\} \qquad (3.3)$$

for the set of record indices and

$$\mathrm{rec}(\sigma) = |\mathrm{Rec}(\sigma)| \qquad (3.4)$$

for its cardinality, and likewise for antirecords.

The record and cycle classifications of indices are related as follows:

(a) Every record is a weak excedance, and every exclusive record is an excedance.

(b) Every antirecord is a weak anti-excedance, and every exclusive antirecord is an anti-excedance.
<figure><img src="image_3.png" /><figcaption>Figure 1: Pictorial representation of the permutation $\sigma = 9374611281015 = (1,9,10) (2,3,7) (4) (5,6,11) (8) \in \mathfrak{S}_{11}$.</figcaption></figure>

(c) Every record-antirecord is a fixed point.

Therefore, by applying the record and cycle classifications simultaneously, we obtain 10 (not 20) disjoint categories [31]:

<table><thead><tr><th></th><th>cpeak</th><th>cval</th><th>cdrise</th><th>cdfall</th><th>fix</th></tr></thead><tbody><tr><td>erec</td><td></td><td>ereccval</td><td>ereccdrise</td><td>eareccdfall</td><td></td></tr><tr><td>earec</td><td>eareccpeak</td><td></td><td></td><td></td><td></td></tr><tr><td>rar</td><td></td><td></td><td></td><td></td><td>rar</td></tr><tr><td>nrar</td><td>nrcpeak</td><td>nrcval</td><td>nrcdrise</td><td>nrcdfall</td><td>nrfix</td></tr></tbody></table>

Clearly every index $i$ belongs to exactly one of these 10 types; we call this the **record-and-cycle classification**. The corresponding sets are Ereccval = Rec ∩ Cval, etc.

## 3.2 Crossings and nestings

We now define (following [31]) some permutation statistics that count *crossings* and *nestings*.

First we associate to each permutation $\sigma \in \mathfrak{S}_N$ a pictorial representation (Figure 1) by placing vertices 1, 2, ..., $N$ along a horizontal axis and then drawing an arc from $i$ to $\sigma(i)$ above (resp. below) the horizontal axis in case $\sigma(i) > i$ [resp. $\sigma(i) < i$]; if $\sigma(i) = i$ we do not draw any arc. Each vertex thus has either out-degree = in-degree = 1 (if it is not a fixed point) or out-degree = in-degree = 0 (if it is a fixed point). Of course, the arrows on the arcs are redundant, because the arrow on an arc above (resp. below) the axis always points to the right (resp. left); we therefore omit the arrows for simplicity.

We then say that a quadruplet $i < j < k < l$ forms an

* *upper crossing* (ucross) if $k = \sigma(i)$ and $l = \sigma(j)$;

* *lower crossing* (lcross) if $i = \sigma(k)$ and $j = \sigma(l)$;

* *upper nesting* (unest) if $l = \sigma(i)$ and $k = \sigma(j)$;

* *lower nesting* (lnest) if $i = \sigma(l)$ and $j = \sigma(k)$.
We also consider some “degenerate” cases with $j = k$, by saying that a triplet $i < j < l$ forms an

• *upper joining* (ujoin) if $j = \sigma(i)$ and $l = \sigma(j)$ [i.e. the index $j$ is a cycle double rise];

• *lower joining* (ljoin) if $i = \sigma(j)$ and $j = \sigma(l)$ [i.e. the index $j$ is a cycle double fall];

• *upper pseudo-nesting* (upsnest) if $l = \sigma(i)$ and $j = \sigma(j)$;

• *lower pseudo-nesting* (lpsnest) if $i = \sigma(l)$ and $j = \sigma(j)$.

These are clearly degenerate cases of crossings and nestings, respectively. See Figure 2. Note that upsnest($\sigma$) = lpsnest($\sigma$) for all $\sigma$, since for each fixed point $j$, the number of pairs $(i, l)$ with $i < j < l$ such that $l = \sigma(i)$ has to equal the number of such pairs with $i = \sigma(l)$; we therefore write these two statistics simply as

$$ \text{psnest}(\sigma) \stackrel{\text{def}}{=} \text{upsnest}(\sigma) = \text{lpsnest}(\sigma). \qquad (3.5) $$

And of course ujoin = cdrise and ljoin = cdfall.

We can further refine the four crossing/nesting categories by examining more closely the status of the inner index ($j$ or $k$) whose *outgoing* arc belongs to the crossing or nesting: that is, $j$ for an upper crossing or nesting, and $k$ for a lower crossing or nesting:

<table><thead><tr><th></th><th>ucross</th><th>unest</th><th>lcross</th><th>lnest</th></tr></thead><tbody><tr><td>$j \in \text{Cval}$</td><td>ucrosscval</td><td>unestcval</td><td></td><td></td></tr><tr><td>$j \in \text{Cdrise}$</td><td>ucrosscdrise</td><td>unestcdrise</td><td></td><td></td></tr><tr><td>$k \in \text{Cpeak}$</td><td></td><td></td><td>lcrosscpeak</td><td>lnestcpeak</td></tr><tr><td>$k \in \text{Cdfall}$</td><td></td><td></td><td>lcrosscdfall</td><td>lnestcdfall</td></tr></tbody></table>

See Figure 3. Please note that for the “upper” quantities the distinguished index (i.e. the one for which we examine both $\sigma$ and $\sigma^{-1}$) is in second position ($j$), while for the “lower” quantities the distinguished index is in third position ($k$).

In fact, a central role in our work will be played (just as in [3,31]) by a refinement of these statistics: rather than counting the *total* numbers of quadruplets $i < j < k < l$ that form upper (resp. lower) crossings or nestings, we will count the number of upper (resp. lower) crossings or nestings that use a particular vertex $j$ (resp. $k$) in second (resp. third) position. More precisely, we define the **index-refined crossing and nesting statistics**

$$ \text{ucross}(j, \sigma) = \#\{i < j < k < l: k = \sigma(i) \text{ and } l = \sigma(j)\} \qquad (3.6a) $$

$$ \text{unest}(j, \sigma) = \#\{i < j < k < l: k = \sigma(j) \text{ and } l = \sigma(i)\} \qquad (3.6b) $$

$$ \text{lcross}(k, \sigma) = \#\{i < j < k < l: i = \sigma(k) \text{ and } j = \sigma(l)\} \qquad (3.6c) $$

$$ \text{lnest}(k, \sigma) = \#\{i < j < k < l: i = \sigma(l) \text{ and } j = \sigma(k)\} \qquad (3.6d) $$
<figure><img src="image_4.png" /><figcaption>Upper crossing</figcaption></figure>

<figure><img src="image_5.png" /><figcaption>Lower crossing</figcaption></figure>

<figure><img src="image_6.png" /><figcaption>Upper nesting</figcaption></figure>

<figure><img src="image_7.png" /><figcaption>Lower nesting</figcaption></figure>

<figure><img src="image_8.png" /><figcaption>Upper joining</figcaption></figure>

<figure><img src="image_9.png" /><figcaption>Lower joining</figcaption></figure>

<figure><img src="image_10.png" /><figcaption>Upper pseudo-nesting</figcaption></figure>

<figure><img src="image_11.png" /><figcaption>Lower pseudo-nesting</figcaption></figure>

Figure 2: Crossing, nesting, joining and pseudo-nesting.
<figure><img src="image_12.png" /><figcaption>Upper crossing of type cval</figcaption></figure>

<figure><img src="image_13.png" /><figcaption>Upper crossing of type cdrise</figcaption></figure>

<figure><img src="image_14.png" /><figcaption>Lower crossing of type cpeak</figcaption></figure>

<figure><img src="image_15.png" /><figcaption>Lower crossing of type cdfall</figcaption></figure>

<figure><img src="image_16.png" /><figcaption>Upper nesting of type cval</figcaption></figure>

<figure><img src="image_17.png" /><figcaption>Upper nesting of type cdrise</figcaption></figure>

<figure><img src="image_18.png" /><figcaption>Lower nesting of type cpeak</figcaption></figure>

<figure><img src="image_19.png" /><figcaption>Lower nesting of type cdfall</figcaption></figure>

<caption>Figure 3: Refined categories of crossing and nesting.</caption>
Note that $\text{ucross}(j, \sigma)$ and $\text{unest}(j, \sigma)$ can be nonzero only when $j$ is an excedance (that is, a cycle valley or a cycle double rise), while $\text{lcross}(k, \sigma)$ and $\text{lnest}(k, \sigma)$ can be nonzero only when $k$ is an anti-excedance (that is, a cycle peak or a cycle double fall).

When $j$ is a fixed point, we also define the analogous quantity for pseudo-nestings:

$$ \text{psnest}(j, \sigma) \stackrel{\text{def}}{=} \#\{i < j: \sigma(i) > j\} = \#\{i > j: \sigma(i) < j\}. \quad (3.7) $$

(Here the two expressions are equal because $\sigma$ is a bijection from $[1, j) \cup (j, n]$ to itself.) In [31, eq. (2.20)] this quantity was called the level of the fixed point $j$ and was denoted $\text{lev}(j, \sigma)$.

# 4 First S-fraction for cycle-alternating permutations

We recall that a permutation $\sigma$ is called cycle-alternating if it has no cycle double rises, cycle double falls, or fixed points; thus, each cycle of $\sigma$ is of even length (call it $2m$) and consists of $m$ cycle valleys and $m$ cycle peaks in alternation. We write $\mathfrak{S}_{2n}^{\text{ca}}$ for the set of cycle-alternating permutations of $[2n]$.

## 4.1 First S-fraction (8 variables)

In [31, Section 2.15] the following 4-variable polynomials were introduced:

$$ Q_n(x, y, u, v) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} x^{\text{eareccpeak}(\sigma)} y^{\text{ereccval}(\sigma)} u^{\text{nrcpeak}(\sigma)} v^{\text{nrcval}(\sigma)}, \quad (4.1) $$

where

$$ \text{eareccpeak}(\sigma) = |\text{Eareccpeak}(\sigma)| = |\text{Arec}(\sigma) \cap \text{Cpeak}(\sigma)| \quad (4.2) $$

and likewise for the others. It was then shown [31, Theorem 2.18] that the ordinary generating function of the polynomials $Q_n$ has the S-type continued fraction

$$ \sum_{n=0}^{\infty} Q_n(x, y, u, v) t^n = \frac{1}{1 - \frac{xyt}{1 - \frac{(x+u)(y+v)t}{1 - \frac{(x+2u)(y+2v)t}{1 - \dots}}}} \quad (4.3) $$

with coefficients

$$ \alpha_n = [x + (n - 1)u] [y + (n - 1)v]. \quad (4.4) $$

We now generalize this by treating even and odd indices separately. That is, we define the polynomials

$$ Q_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} x_e^{\text{eareccpeakeven}(\sigma)} y_e^{\text{ereccvaleven}(\sigma)} u_e^{\text{nrcpeakeven}(\sigma)} v_e^{\text{nrcvaleven}(\sigma)} \times x_o^{\text{eareccpeakodd}(\sigma)} y_o^{\text{ereccvalodd}(\sigma)} u_o^{\text{nrcpeakodd}(\sigma)} v_o^{\text{nrcvalodd}(\sigma)}, \quad (4.5) $$
where

$$ \text{eareccpeakeven}(\sigma) = |\text{Eareccpeakeven}(\sigma)| = |\text{Arec}(\sigma) \cap \text{Cpeak}(\sigma) \cap \text{Even}| \quad (4.6) $$

and likewise for the others. We then have:

**Theorem 4.1** (First S-fraction for cycle-alternating permutations). The ordinary generating function of the polynomials $Q_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o)$ has the S-type continued fraction

$$ \sum_{n=0}^{\infty} Q_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o) t^n = \frac{1}{1 - \frac{x_e y_o t}{1 - \frac{(x_o+u_o)(y_e+v_e)t}{1 - \frac{(x_e+2u_e)(y_o+2v_o)t}{1 - \dots}}}} \quad (4.7) $$

with coefficients

$$ \alpha_{2k-1} = [x_e + (2k-2)u_e] [y_o + (2k-2)v_o] \quad (4.8a) $$

$$ \alpha_{2k} = [x_o + (2k-1)u_o] [y_e + (2k-1)v_e] \quad (4.8b) $$

The proof of this theorem is based on the “master” S-fraction for cycle-alternating permutations [31, Theorem 2.20] together with the following lemma:

**Lemma 4.2** (Key lemma). If $\sigma$ is a cycle-alternating permutation of $[2n]$, then

$$ \text{cycle valleys: } \text{ucross}(i, \sigma) + \text{unest}(i, \sigma) \equiv i - 1 \pmod{2} \quad (4.9a) $$

$$ \text{cycle peaks: } \text{lcross}(i, \sigma) + \text{lnest}(i, \sigma) \equiv i \pmod{2} \quad (4.9b) $$

for all $i \in [2n]$.

**PROOF.** In the Foata-Zeilberger bijection for permutations as presented in [31, Section 6.1], permutations $\sigma \in \mathfrak{S}_N$ are mapped bijectively onto pairs $(\omega, \xi)$, where $\omega = (\omega_0, \dots, \omega_N)$ is a Motzkin path of length $N$, and $\xi$ is a suitably defined set of integer labels $(\xi_1, \dots, \xi_N)$. We write $h_i$ for the height of the Motzkin path after step $i$, i.e. $\omega_i = (i, h_i)$. From [31, eqns. (6.6)–(6.9)] and the definition of the steps $s_i = h_i - h_{i-1}$, we get

$$ \text{cval: } \text{ucross}(i, \sigma) + \text{unest}(i, \sigma) = h_{i-1} = h_i - 1 \quad (4.10a) $$

$$ \text{cdrise: } \text{ucross}(i, \sigma) + \text{unest}(i, \sigma) = h_{i-1} - 1 = h_i - 1 \quad (4.10b) $$

$$ \text{cpeak: } \text{lcross}(i, \sigma) + \text{lnest}(i, \sigma) = h_{i-1} - 1 = h_i \quad (4.10c) $$

$$ \text{cdfall: } \text{lcross}(i, \sigma) + \text{lnest}(i, \sigma) = h_{i-1} - 1 = h_i - 1 \quad (4.10d) $$

On the other hand, for a cycle-alternating permutation, the path $\omega$ is a Dyck path (i.e. there are no level steps), so that $h_i \equiv i \pmod{2}$. $\square$

We now apply the first master S-fraction for cycle-alternating permutations [31, Theorem 2.20], which states that the polynomials

$$ Q_n(\mathbf{a}, \mathbf{b}) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} \prod_{i \in \text{Cval}} \mathbf{a}_{\text{ucross}(i, \sigma), \text{unest}(i, \sigma)} \prod_{i \in \text{Cpeak}} \mathbf{b}_{\text{lcross}(i, \sigma), \text{lnest}(i, \sigma)} \quad (4.11) $$
in indeterminates $\mathbf{a} = (\mathbf{a}_{\ell,\ell'})_{\ell,\ell' \ge 0}$ and $\mathbf{b} = (\mathbf{b}_{\ell,\ell'})_{\ell,\ell' \ge 0}$ have the S-type continued fraction

$$ \sum_{n=0}^{\infty} Q_n(\mathbf{a}, \mathbf{b}) t^n = \frac{1}{1 - \frac{\mathbf{a}_{00}\mathbf{b}_{00}t}{1 - \frac{(\mathbf{a}_{01} + \mathbf{a}_{10})(\mathbf{b}_{01} + \mathbf{b}_{10})t}{1 - \frac{(\mathbf{a}_{02} + \mathbf{a}_{11} + \mathbf{a}_{20})(\mathbf{b}_{02} + \mathbf{b}_{11} + \mathbf{b}_{20})t}{1 - \dots}}} \quad (4.12) $$

with coefficients

$$ \alpha_n = \left( \sum_{\ell=0}^{n-1} \mathbf{a}_{\ell,n-1-\ell} \right) \left( \sum_{\ell=0}^{n-1} \mathbf{b}_{\ell,n-1-\ell} \right). \quad (4.13) $$

We also use the following general fact about permutations

**Lemma 4.3.** [31, Lemma 2.10] Let $\sigma$ be a permutation.

(a) If $i$ is a cycle valley or cycle double rise, then $i$ is a record if and only if $\text{unest}(i, \sigma) = 0$; and in this case it is an exclusive record.

(b) If $i$ is a cycle peak or cycle double fall, then $i$ is an antirecord if and only if $\text{lnest}(i, \sigma) = 0$; and in this case it is an exclusive antirecord.

Applying Lemma 4.3 to cycle valleys and peaks in a cycle-alternating permutation, it follows that the polynomials $Q_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o)$ are obtained by specializing $Q_n(\mathbf{a}, \mathbf{b})$ to

$$ \mathbf{a}_{\ell,\ell'} = \begin{cases} y_o & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is even} \\ v_o & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is even} \\ y_e & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is odd} \\ v_e & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is odd} \end{cases} \quad (4.14a) $$

$$ \mathbf{b}_{\ell,\ell'} = \begin{cases} x_e & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is even} \\ u_e & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is even} \\ x_o & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is odd} \\ u_o & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is odd} \end{cases} \quad (4.14b) $$

Inserting these into (4.13) yields (4.8). This completes the proof of Theorem 4.1.

**Remarks.** 1. If we specialize Theorem 4.1 to $u_e = x_e$, $u_o = x_o$, $y_e = v_e = y_o = v_o = 1$, we obtain an S-fraction with coefficients $\alpha_{2k-1} = (2k-1)^2 x_e$, $\alpha_{2k} = (2k)^2 x_o$. This is the S-fraction for the polynomials $\mathcal{E}_{2n}(x_e, x_o)$, which generalize the secant numbers $E_{2n}$ as follows: Start from the Jacobian elliptic functions sn, cn, dn in Dumont's [10] symmetric parametrization, which are defined by the system of differential equations

$$ \frac{d}{du} \operatorname{sn}(u; a, b) = \operatorname{cn}(u; a, b) \operatorname{dn}(u; a, b) \quad (4.15a) $$

$$ \frac{d}{du} \operatorname{cn}(u; a, b) = a^2 \operatorname{dn}(u; a, b) \operatorname{sn}(u; a, b) \quad (4.15b) $$

$$ \frac{d}{du} \operatorname{dn}(u; a, b) = b^2 \operatorname{sn}(u; a, b) \operatorname{cn}(u; a, b) \quad (4.15c) $$
with the initial conditions $\operatorname{sn}(0; a, b) = 0$, $\operatorname{cn}(0; a, b) = 1$, $\operatorname{dn}(0; a, b) = 1$. Note the special cases

$$ \operatorname{sn}(u; a, 0) = \frac{\sinh au}{a} \qquad (4.16a) $$

$$ \operatorname{cn}(u; a, 0) = \cosh au \qquad (4.16b) $$

$$ \operatorname{dn}(u; a, 0) = 1 \qquad (4.16c) $$

and

$$ \operatorname{sn}(u; a, a) = \frac{\tan au}{a} \qquad (4.17a) $$

$$ \operatorname{cn}(u; a, a) = \sec au \qquad (4.17b) $$

$$ \operatorname{dn}(u; a, a) = \sec au \qquad (4.17c) $$

Thus, $\operatorname{sn}$ is a simultaneous generalization of tangent and hyperbolic sine, while $\operatorname{cn}$ is a simultaneous generalization of secant and hyperbolic cosine. The Taylor expansions around $u = 0$ have the form

$$ \operatorname{cn}(u; a, b) = \sum_{n=0}^{\infty} \mathcal{E}_{2n}(a^2, b^2) \frac{u^{2n}}{(2n)!} \qquad (4.18) $$

$$ \operatorname{sn}(u; a, b) = \sum_{n=0}^{\infty} \mathcal{E}_{2n+1}(a^2, b^2) \frac{u^{2n+1}}{(2n+1)!} \qquad (4.19) $$

where $\mathcal{E}_{2n}(\alpha, \beta)$ and $\mathcal{E}_{2n+1}(\alpha, \beta)$ are homogeneous polynomials of degree $n$ in the indeterminates $\alpha$ and $\beta$, with nonnegative integer coefficients. Then the ordinary generating function of the polynomials $\mathcal{E}_{2n}$ can be expressed as an S-fraction

$$ \sum_{n=0}^{\infty} t^n \mathcal{E}_{2n}(\alpha, \beta) = \frac{1}{1 - \frac{1^2 \alpha t}{1 - \frac{2^2 \beta t}{1 - \frac{3^2 \alpha t}{1 - \dots}}}} \qquad (4.20) $$

with coefficients

$$ \alpha_{2k-1} = (2k-1)^2 \alpha \qquad (4.21a) $$

$$ \alpha_{2k} = (2k)^2 \beta \qquad (4.21b) $$

This S-fraction goes back to Stieltjes [34, p. H17] and Rogers [26, p. 77]; modern presentations of Rogers' elegant proof can be found in Flajolet and Françon [16, Theorem 1] and Milne [22, Theorems 3.2 and 3.11]. The polynomials $\mathcal{E}_{2n}(\alpha, \beta)$ are also specializations of the three-variable Schett polynomials [9–11, 27, 28] $X_{2n}(x, y, z)$, for which Dumont [9–11] has provided a combinatorial interpretation in terms of even and odd cycle peaks in permutations of $[2n]$. When specialized to $z = 0$, one obtains
cycle-alternating permutations, and Dumont's interpretation agrees with ours. The continued fraction (4.20) can be found on [11, p. 38].

2. The continued fraction of Theorem 4.1, specialized to $x_e = u_e = v_e = x_o = u_o = v_o = 1$, enumerates cycle-alternating permutations of $[2n]$ with respect to odd and even records, and has coefficients $\alpha_{2k-1} = (2k-1)(2k-2+y_o)$, $\alpha_{2k} = (2k)(2k-1+y_e)$. This same continued fraction was found by Randrianarivony and Zeng [25, Théorème 3] as enumerating even and odd record values in alternating (not cycle-alternating) permutations. This is a “linear statistics” analogue of our “cyclic statistics” results.

## 4.2 p, q-generalization of first S-fraction (16 variables)

We can further extend Theorem 4.1 by introducing a p, q-generalization. The statistics on permutations corresponding to the variables p and q will be crossings and nestings, as defined in Section 3.2.

Recall first that for an integer $n \ge 0$ we define

$$[n]_{p,q} = \frac{p^n - q^n}{p - q} = \sum_{j=0}^{n-1} p^j q^{n-1-j} \quad (4.22)$$

where p and q are indeterminates; it is a homogeneous polynomial of degree $n-1$ in p and q, which is symmetric in p and q. In particular, $[0]_{p,q} = 0$ and $[1]_{p,q} = 1$; and for $n \ge 1$ we have the recurrence

$$[n]_{p,q} = p[n-1]_{p,q} + q^{n-1} = q[n-1]_{p,q} + p^{n-1}. \quad (4.23)$$

If $p=1$, then $[n]_{1,q}$ is the well-known q-integer

$$[n]_q = [n]_{1,q} = \frac{1-q^n}{1-q} = \begin{cases} 0 & \text{if } n=0 \\ 1+q+q^2+\dots+q^{n-1} & \text{if } n \ge 1 \end{cases} \quad (4.24)$$

If $p=0$, then

$$[n]_{0,q} = \begin{cases} 0 & \text{if } n=0 \\ q^{n-1} & \text{if } n \ge 1 \end{cases} \quad (4.25)$$

In [31, Section 2.15] the following 8-variable polynomials were introduced:

$$Q_n(x, y, u, v, p_+, p_-, q_+, q_-) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} x^{\text{eareccpeak}(\sigma)} y^{\text{ereccval}(\sigma)} u^{\text{nrcpeak}(\sigma)} v^{\text{nrcval}(\sigma)} \times p_-^{\text{lcrosspeak}(\sigma)} p_+^{\text{ucrosscval}(\sigma)} q_-^{\text{lnestpeak}(\sigma)} q_+^{\text{unestcval}(\sigma)} \quad (4.26)$$

It was then shown [31, Theorem 2.19] that the ordinary generating function of the
polynomials $Q_n$ has the S-type continued fraction

$$ \sum_{n=0}^{\infty} Q_n(x, y, u, v, p_+, p_-, q_+, q_-) t^n = \frac{1}{1 - \frac{xyt}{1 - \frac{(p_-x+q_−u)(p_+y+q_+v)t}{1 - \frac{(p_-^2x+q_−[2]_{p_−,q_−}u)(p_+^2y+q_+[2]_{p_+,q_+}v)t}{1-\dots}}}} \quad (4.27) $$

with coefficients

$$ \alpha_n = (p_-^{n-1}x + q_-[n-1]_{p_-, q_-}u) (p_+^{n-1}y + q_+[n-1]_{p_+, q_+}v). \quad (4.28) $$

We now generalize this by treating even and odd indices separately. That is, we define the polynomials

$$ Q_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o, p_{-1}, p_{-2}, p_{+1}, p_{+2}, q_{-1}, q_{-2}, q_{+1}, q_{+2}) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} x_e^{\text{eareccpkeakeven}(\sigma)} y_e^{\text{ereccvaleven}(\sigma)} u_e^{\text{nrcpkeakeven}(\sigma)} v_e^{\text{nrcvaleven}(\sigma)} \times x_o^{\text{eareccpeakodd}(\sigma)} y_o^{\text{ereccvalodd}(\sigma)} u_o^{\text{nrcpeakodd}(\sigma)} v_o^{\text{nrcvalodd}(\sigma)} \times p_{-1}^{\text{lcrosspkeakeven}(\sigma)} p_{-2}^{\text{lcrosspeakodd}(\sigma)} p_{+1}^{\text{ucrosscvalodd}(\sigma)} p_{+2}^{\text{ucrossvaleven}(\sigma)} \times q_{-1}^{\text{lnestpkeakeven}(\sigma)} q_{-2}^{\text{lnestpeakodd}(\sigma)} q_{+1}^{\text{unestcvalodd}(\sigma)} q_{+2}^{\text{unestcvaleven}(\sigma)}, \quad (4.29) $$

where

$$ \text{lcrosspkeakeven}(\sigma) = \sum_{j \in \text{Cpeak}(\sigma) \cap \text{Even}} \text{lcross}(j, \sigma) \quad (4.30) $$

and likewise for the others. We then have:

**Theorem 4.4** (First S-fraction for cycle-alternating permutations, p, q-generalization). The ordinary generating function of the polynomials (4.29) has the S-type continued fraction

$$ \sum_{n=0}^{\infty} Q_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o, p_{-1}, p_{-2}, p_{+1}, p_{+2}, q_{-1}, q_{-2}, q_{+1}, q_{+2}) t^n = \frac{1}{1 - \frac{x_e y_o t}{1 - \frac{(p_{-2}x_o + q_{-2}u_o)(p_{+2}y_e + q_{+2}v_e)t}{1 - \frac{(p_{-1}^2 x_e + q_{-1}[2]_{p_{-1},q_{-1}}u_e)(p_{+1}^2 y_o + q_{+1}[2]_{p_{+1},q_{+1}}v_o)t}{1 - \dots}}}}} \quad (4.31a) $$

with coefficients

$$ \alpha_{2k-1} = (p_{-1}^{2k-2}x_e + q_{-1}[2k-2]_{p_{-1},q_{-1}}u_e) (p_{+1}^{2k-2}y_o + q_{+1}[2k-2]_{p_{+1},q_{+1}}v_o) \quad (4.32a) $$

$$ \alpha_{2k} = (p_{-2}^{2k-1}x_o + q_{-2}[2k-1]_{p_{-2},q_{-2}}u_o) (p_{+2}^{2k-1}y_e + q_{+2}[2k-1]_{p_{+2},q_{+2}}v_e) \quad (4.32b) $$
PROOF. Notice that we obtain the polynomials (4.29) by specializing the polynomials $Q_n(\mathbf{a}, \mathbf{b})$ defined in (4.11) to

$$ \mathbf{a}_{\ell, \ell'} = \begin{cases} p_{+1}^{\ell} y_o & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is even} \\ p_{+1}^{\ell} q_{+1}^{\ell'} v_o & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is even} \\ p_{+2}^{\ell} y_e & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is odd} \\ p_{+2}^{\ell} q_{+2}^{\ell'} v_e & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is odd} \end{cases} \quad (4.33a) $$

$$ \mathbf{b}_{\ell, \ell'} = \begin{cases} p_{-1}^{\ell} x_e & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is even} \\ p_{-1}^{\ell} q_{-1}^{\ell'} u_e & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is even} \\ p_{-2}^{\ell} x_o & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is odd} \\ p_{-2}^{\ell} q_{-2}^{\ell'} u_o & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is odd} \end{cases} \quad (4.33b) $$

Inserting these into (4.13) yields (4.32). This along with Lemma 4.2 completes the proof of Theorem 4.4. $\square$

**Remark.** We can also obtain Biane's [1, section 6] S-fraction for the $q$-secant numbers $E_{2n}(q)$, defined as counting cycle-alternating permutations by number of inversions. We recall [31, Proposition 2.24] that the number of inversions in a permutation $\sigma$ satisfies

$$ \mathrm{inv} = \mathrm{cval} + \mathrm{cdrise} + \mathrm{cdfall} + \mathrm{ucross} + \mathrm{lcross} + 2(\mathrm{unest} + \mathrm{lnest} + \mathrm{psnest}) . \quad (4.34) $$

For a cycle-alternating permutation we have $\mathrm{cdrise} = \mathrm{cdfall} = \mathrm{psnest} = 0$. Evaluating (4.26) with $x = u = 1$, $y = v = q$, $p_{-} = p_{+} = q$ and $q_{-} = q_{+} = q^2$ and using (4.27)/(4.28), we obtain after a bit of algebra $\alpha_n = q^{2n-1}[n]_q^2$, which agrees with Biane's formula. $\blacksquare$

# 5 Second S-fraction for cycle-alternating permutations

## 5.1 Second S-fraction (counting of cycles)

It is now natural to want to generalize the foregoing polynomials by introducing also the counting of cycles. That is, we define the polynomials

$$ \hat{Q}_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o, \lambda) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\mathrm{ca}}} x_e^{\mathrm{eareccpeakeven}(\sigma)} y_e^{\mathrm{ereccvaleven}(\sigma)} u_e^{\mathrm{nrcpeakeven}(\sigma)} v_e^{\mathrm{nrcvaleven}(\sigma)} \times x_o^{\mathrm{eareccpeakodd}(\sigma)} y_o^{\mathrm{ereccvalodd}(\sigma)} u_o^{\mathrm{nrcpeakodd}(\sigma)} v_o^{\mathrm{nrcvalodd}(\sigma)} \lambda^{\mathrm{cyc}(\sigma)}, \quad (5.1) $$

which generalize the polynomials (4.5) by including a factor $\lambda^{\mathrm{cyc}(\sigma)}$.

Unfortunately, it is not possible to obtain an S-fraction (or even a J-fraction) with polynomial coefficients for (5.1). Indeed, it is not possible to obtain a J-fraction with polynomial coefficients even for the 3-variable specialization

$$ P_n(x, y, \lambda) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\mathrm{ca}}} x^{\mathrm{eareccpeak}(\sigma)} y^{\mathrm{ereccval}(\sigma)} \lambda^{\mathrm{cyc}(\sigma)}. \quad (5.2) $$
We show this in the Appendix.

However, it is possible to obtain a nice S-fraction for the polynomials (5.1) if we make the specializations $y_e = v_e$ and $y_o = v_o$:

**Theorem 5.1** (Second S-fraction for cycle-alternating permutations). *The ordinary generating function of the polynomials $\hat{Q}_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o, \lambda)$ with the specializations $y_e = v_e$ and $y_o = v_o$ has the S-type continued fraction*

$$ \sum_{n=0}^{\infty} \hat{Q}_n(x_e, y_e, u_e, y_e, x_o, y_o, u_o, y_o, \lambda) t^n = \frac{1}{1 - \frac{\lambda x_e y_o t}{1 - \frac{(\lambda+1)(x_o+u_o)y_e t}{1 - \frac{(\lambda+2)(x_e+2u_e)y_o t}{1 - \dots}}}} \quad (5.3) $$

with coefficients

$$ \alpha_{2k-1} = (\lambda + 2k - 2) [x_e + (2k - 2)u_e] y_o \quad (5.4a) $$

$$ \alpha_{2k} = (\lambda + 2k - 1) [x_o + (2k - 1)u_o] y_e \quad (5.4b) $$

This generalizes [31, Theorem 2.21] by treating even and odd indices separately.

The proof of Theorem 5.1 will be obtained as a specialization of Theorem 5.2.

When $x_e = y_e = u_e = v_e = x_o = y_o = u_o = v_o = 1$, the polynomials $\hat{Q}_n$ reduce to the secant power polynomials $E_{2n}(\lambda)$, as will be shown in Section 6.3.

## 5.2 p, q-generalization of second S-fraction

We now introduce a p, q-generalization of (5.1):

$$ \hat{Q}_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o, p_{-1}, p_{-2}, p_{+1}, p_{+2}, q_{-1}, q_{-2}, q_{+1}, q_{+2}, \lambda) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} x_e^{\text{eareccpkeakeven}(\sigma)} y_e^{\text{ereccvaleven}(\sigma)} u_e^{\text{nrcpkeakeven}(\sigma)} v_e^{\text{nrcvaleven}(\sigma)} \times x_o^{\text{eareccpeakodd}(\sigma)} y_o^{\text{ereccvalodd}(\sigma)} u_o^{\text{nrcpeakodd}(\sigma)} v_o^{\text{nrcvalodd}(\sigma)} \times p_{-1}^{\text{lcrosscpeakeven}(\sigma)} p_{-2}^{\text{lcrosscpeakodd}(\sigma)} p_{+1}^{\text{ucrosscvalodd}(\sigma)} p_{+2}^{\text{ucrossvaleven}(\sigma)} \times q_{-1}^{\text{lnestcpeakeven}(\sigma)} q_{-2}^{\text{lnestpeakodd}(\sigma)} q_{+1}^{\text{unestcvalodd}(\sigma)} q_{+2}^{\text{unestvaleven}(\sigma)} \lambda^{\text{cyc}(\sigma)}. \quad (5.5) $$

We then have:

**Theorem 5.2** (Second S-fraction for cycle-alternating permutations, p, q-generalization).

*The ordinary generating function of the polynomials (5.5) with the specializations $y_e = v_e, y_o = v_o, p_{+1} = q_{+1}$ and $p_{+2} = q_{+2}$ has the S-type continued fraction*

$$ \sum_{n=0}^{\infty} \hat{Q}_n(x_e, y_e, u_e, y_e, x_o, y_o, u_o, y_o, p_{-1}, p_{-2}, p_{+1}, p_{+2}, q_{-1}, q_{-2}, p_{+1}, p_{+2}, \lambda) t^n = \frac{1}{1 - \frac{\lambda x_e y_o t}{1 - \frac{(\lambda+1)(p_{-2}x_o + q_{-2}u_o)p_{+2}y_e t}{1 - \frac{(\lambda+2)(p_{-1}^2 x_e + q_{-1}[2]_{p_{-1},q_{-1}} u_e) p_{+1}^2 y_o t}{1 - \dots}}}} \quad (5.6) $$
with coefficients

$$ \alpha_{2k-1} = (\lambda + 2k - 2) (p_{-1}^{2k-2} x_e + q_{-1}[2k-2]_{p_{-1}, q_{-1}} u_e) p_{+1}^{2k-2} y_o \quad (5.7a) $$

$$ \alpha_{2k} = (\lambda + 2k - 1) (p_{-2}^{2k-1} x_o + q_{-2}[2k-1]_{p_{-2}, q_{-2}} u_o) p_{+2}^{2k-1} y_e \quad (5.7b) $$

This generalizes [31, Theorem 2.22] by treating even and odd indices separately.

The proof of this theorem (and thus also of Theorem 5.1) will be based on the “second master” S-fraction for cycle-alternating permutations [31, Theorem 2.23] together with Lemma 4.2. We first recall that second master S-fraction: it states that the polynomials

$$ \hat{Q}_n(\mathbf{a}, \mathbf{b}, \lambda) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} \lambda^{\text{cyc}(\sigma)} \prod_{i \in \text{Cval}} \mathbf{a}_{\text{ucross}(i, \sigma) + \text{unest}(i, \sigma)} \prod_{i \in \text{Cpeak}} \mathbf{b}_{\text{lcross}(i, \sigma), \text{lnest}(i, \sigma)} \quad (5.8) $$

in indeterminates $\mathbf{a} = (\mathbf{a}_\ell)_{\ell \ge 0}$ and $\mathbf{b} = (\mathbf{b}_{\ell, \ell'})_{\ell, \ell' \ge 0}$ have the S-type continued fraction

$$ \sum_{n=0}^{\infty} \hat{Q}_n(\mathbf{a}, \mathbf{b}, \lambda) t^n = \frac{1}{1 - \frac{\lambda \mathbf{a}_0 \mathbf{b}_{00} t}{1 - \frac{(\lambda + 1) \mathbf{a}_1 (\mathbf{b}_{01} + \mathbf{b}_{10}) t}{1 - \frac{(\lambda + 2) \mathbf{a}_2 (\mathbf{b}_{02} + \mathbf{b}_{11} + \mathbf{b}_{20}) t}{1 - \dots}}} \quad (5.9) $$

with coefficients

$$ \alpha_n = (\lambda + n - 1) \mathbf{a}_{n-1} \left( \sum_{\ell=0}^{n-1} \mathbf{b}_{\ell, n-1-\ell} \right). \quad (5.10) $$

Notice that, in contrast to (4.11), the indeterminates $\mathbf{a}$ now have only one index: we are unable to count ucross and unest separately, but can only count their sum. This is the price we pay for being able to count cycles.

PROOF OF THEOREM 5.2. Notice that we obtain the polynomials (5.5) by specializing the polynomials $\hat{Q}_n(\mathbf{a}, \mathbf{b}, \lambda)$ defined in (5.8) to

$$ \mathbf{a}_{\ell} = \begin{cases} p_{+1}^{\ell} y_o & \text{if } \ell \text{ is even} \\ p_{+2}^{\ell} y_e & \text{if } \ell \text{ is odd} \end{cases} \quad (5.11a) $$

$$ \mathbf{b}_{\ell, \ell'} = \begin{cases} p_{-1}^{\ell} x_e & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is even} \\ p_{-1}^{\ell} q_{-1}^{\ell'} u_e & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is even} \\ p_{-2}^{\ell} x_o & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is odd} \\ p_{-2}^{\ell} q_{-2}^{\ell'} u_o & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is odd} \end{cases} \quad (5.11b) $$

Inserting these into (5.10) yields (5.7). This along with Lemma 4.2 completes the proof of Theorem 5.2. $\square$

PROOF OF THEOREM 5.1. Specialize Theorem 5.2 to $p_{+1} = p_{+2} = p_{-1} = p_{-2} = q_{-1} = q_{-2} = 1$. $\square$
## 5.3 Alternating cycles

Let $\mathfrak{C}_N \subseteq \mathfrak{S}_N$ denote the set of permutations of $[N]$ consisting of exactly one cycle. Then let $\mathcal{A}\mathfrak{C}_{2n} = \mathfrak{C}_{2n} \cap \mathfrak{S}_{2n}^{\text{ca}}$ denote the set of cycle-alternating permutations of $[2n]$ consisting of exactly one cycle, or **alternating cycles** for short. Dumont [11, section 3 and p. 40] showed that alternating cycles are enumerated by the down-shifted tangent numbers, i.e. $|\mathcal{A}\mathfrak{C}_{2n}| = E_{2n-1}$. Here we will recover this result, and extend it to a more refined S-fraction.

We can enumerate alternating cycles by extracting the coefficient of $\lambda^1$ in the preceding results (namely, Theorems 5.1 and 5.2 and eq. (5.9)). We begin by defining the polynomials analogous to (4.5), (4.29) and (5.8) but restricted to alternating cycles:

$$Q_n^{\mathcal{A}\mathfrak{C}}(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o) = \sum_{\sigma \in \mathcal{A}\mathfrak{C}_{2n}} x_e^{\text{eareccpkeakeven}(\sigma)} y_e^{\text{ereccvaleven}(\sigma)} u_e^{\text{nrcpkeakeven}(\sigma)} v_e^{\text{nrcvaleven}(\sigma)} \times x_o^{\text{eareccpeakodd}(\sigma)} y_o^{\text{ereccvalodd}(\sigma)} u_o^{\text{nrcpeakodd}(\sigma)} v_o^{\text{nrcvalodd}(\sigma)} \quad (5.12)$$

$$Q_n^{\mathcal{A}\mathfrak{C}}(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o, p_{-1}, p_{-2}, p_{+1}, p_{+2}, q_{-1}, q_{-2}, q_{+1}, q_{+2}) = \sum_{\sigma \in \mathcal{A}\mathfrak{C}_{2n}} x_e^{\text{eareccpkeakeven}(\sigma)} y_e^{\text{ereccvaleven}(\sigma)} u_e^{\text{nrcpkeakeven}(\sigma)} v_e^{\text{nrcvaleven}(\sigma)} \times x_o^{\text{eareccpeakodd}(\sigma)} y_o^{\text{ereccvalodd}(\sigma)} u_o^{\text{nrcpeakodd}(\sigma)} v_o^{\text{nrcvalodd}(\sigma)} \times p_{-1}^{\text{lcrosscpeakeven}(\sigma)} p_{-2}^{\text{lcrosscpeakodd}(\sigma)} p_{+1}^{\text{ucrosscvalodd}(\sigma)} p_{+2}^{\text{ucrossvaleven}(\sigma)} \times q_{-1}^{\text{lnestcpeakeven}(\sigma)} q_{-2}^{\text{lnestpeakodd}(\sigma)} q_{+1}^{\text{unestcvalodd}(\sigma)} q_{+2}^{\text{unestvaleven}(\sigma)} \quad (5.13)$$

$$Q_n^{\mathcal{A}\mathfrak{C}}(\mathbf{a}, \mathbf{b}) = \sum_{\sigma \in \mathcal{A}\mathfrak{C}_{2n}} \prod_{i \in \text{Cval}} \mathbf{a}_{\text{ucross}(i,\sigma) + \text{unest}(i,\sigma)} \prod_{i \in \text{Cpeak}} \mathbf{b}_{\text{lcross}(i,\sigma), \text{lnest}(i,\sigma)} \quad (5.14)$$

Since the results for alternating cycles will arise by specialization of the results that include counting of cycles, the same specializations are needed to obtain nice continued fractions. Extracting the coefficient of $\lambda^1$ in Theorem 5.1, we deduce the following:

**Corollary 5.3 (S-fraction for alternating cycles).** *The ordinary generating function of the polynomials (5.12) with the specializations $y_e = v_e$ and $y_o = v_o$ has the S-type continued fraction*

$$\sum_{n=0}^{\infty} Q_{n+1}^{\mathcal{A}\mathfrak{C}}(x_e, y_e, u_e, y_e, x_o, y_o, u_o, y_o) t^n = \frac{x_e y_o}{1 - \frac{(x_o + u_o)y_e t}{1 - \frac{2(x_e + 2u_e)y_o t}{1 - \dots}}} \quad (5.15)$$

with coefficients

$$\alpha_{2k-1} = (2k-1) [x_o + (2k-1)u_o] y_e \quad (5.16a)$$

$$\alpha_{2k} = 2k [x_e + 2ku_e] y_o \quad (5.16b)$$
Specializing to $x_e = y_e = u_e = x_o = y_o = u_o = 1$, we see that $|\mathcal{A}\mathfrak{C}_{2n+2}|$ has an S-fraction with coefficients $\alpha_n = n(n+1)$, which is well known to be the S-fraction for the tangent numbers $E_{2n+1}$ [23, A000182]. In other words, $|\mathcal{A}\mathfrak{C}_{2n}| = E_{2n-1}$.

Similarly, extracting the coefficient of $\lambda^1$ in Theorem 5.2, we deduce:

**Corollary 5.4** (S-fraction for alternating cycles, $p, q$-generalization). *The ordinary generating function of the polynomials (5.13) with the specializations $y_e = v_e$, $y_o = v_o$, $p_{+1} = q_{+1}$ and $p_{+2} = q_{+2}$ has the S-type continued fraction*

$$ \sum_{n=0}^{\infty} Q_{n+1}^{\mathcal{A}\mathfrak{C}}(x_e, y_e, u_e, y_e, x_o, y_o, u_o, y_o, p_{-1}, p_{-2}, p_{+1}, p_{+2}, q_{-1}, q_{-2}, p_{+1}, p_{+2}) t^n = \frac{x_e y_o}{1 - \frac{(p_{-2}x_o + q_{-2}u_o)p_{+2}y_e t}{1 - \frac{2(p_{-1}^2 x_e + q_{-1}[2]_{p_{-1},q_{-1}}u_e)p_{+1}^2 y_o t}{1 - \dots}}} \quad (5.17) $$

with coefficients

$$ \alpha_{2k-1} = (2k-1) (p_{-2}^{2k-1} x_o + q_{-2}[2k-1]_{p_{-2},q_{-2}} u_o) p_{+2}^{2k-1} y_e \quad (5.18a) $$

$$ \alpha_{2k} = 2k (p_{-1}^{2k} x_e + q_{-1}[2k]_{p_{-1},q_{-1}} u_e) p_{+1}^{2k} y_o \quad (5.18b) $$

Finally, extracting the coefficient of $\lambda^1$ in (5.9)/(5.10), we obtain:

**Corollary 5.5** (Master S-fraction for alternating cycles). *The ordinary generating function of the polynomials (5.14) has the S-type continued fraction*

$$ \sum_{n=0}^{\infty} Q_{n+1}^{\mathcal{A}\mathfrak{C}}(\mathbf{a}, \mathbf{b}) t^n = \frac{\mathbf{a}_0 \mathbf{b}_{00}}{1 - \frac{\mathbf{a}_1(\mathbf{b}_{01} + \mathbf{b}_{10})t}{1 - \frac{2\mathbf{a}_2(\mathbf{b}_{02} + \mathbf{b}_{11} + \mathbf{b}_{20})t}{1 - \dots}}} \quad (5.19) $$

with coefficients

$$ \alpha_n = n \mathbf{a}_n \left( \sum_{\ell=0}^{n} \mathbf{b}_{\ell,n-\ell} \right) . \quad (5.20) $$

## 5.4 Open problem: Combinatorial model for the tangent numbers

Let us start by noting the inequalities

$$ E_{2n-1} \le E_{2n} \le E_{2n+1} \le (2n)! . \quad (5.21) $$

We have just seen that the down-shifted tangent numbers $E_{2n-1}$ enumerate the set $\mathcal{A}\mathfrak{C}_{2n}$ of alternating cycles on $[2n]$, while the secant numbers $E_{2n}$ enumerate the set $\mathfrak{S}_{2n}^{\text{ca}}$ of cycle-alternating permutations of $[2n]$. The inequality $E_{2n} \le E_{2n+1} \le (2n)!$ suggests that also the tangent numbers $E_{2n+1}$ should enumerate some class of permutations of $[2n]$ that contains $\mathfrak{S}_{2n}^{\text{ca}}$. What class? We pose this as an open problem:
**Open Problem 5.6.**

(a) Find a natural class $\mathcal{C}$ satisfying $\mathfrak{S}_{2n}^{\text{ca}} \subseteq \mathcal{C} \subseteq \mathfrak{S}_{2n}$ and $|\mathcal{C}| = E_{2n+1}$.

(b) Find statistics on $\mathcal{C}$ whose generating polynomials have a nice $S$-fraction that generalizes the coefficients $\alpha_n = n(n+1)$ for the tangent numbers. Ideally these statistics would also be such that, by specializing some variables to zero, we reobtain some or all of the continued fractions of the present paper for cycle-alternating permutations.

We remark that an analogous situation occurs for the Genocchi numbers $g_n$ and the median Genocchi numbers $h_n$ (in the notation of [3]), which satisfy

$$g_{n-1} \le h_n \le g_n \le h_{n+1} \le (2n)! . \qquad (5.22)$$

In this case the relevant objects are a class of permutations of $[2n]$ called D-permutations [20, 21] and their subsets

$$\text{D-cycles} \subseteq \text{D-derangements} \subseteq \text{D-semiderangements} \subseteq \text{D-permutations}, \quad (5.23)$$

and we have [3, 8, 12, 20, 21]

$$|\text{D-cycles}| = g_{n-1} \qquad (5.24a)$$

$$|\text{D-derangements}| = h_n \qquad (5.24b)$$

$$|\text{D-semiderangements}| = g_n \qquad (5.24c)$$

$$|\text{D-permutations}| = h_{n+1} \qquad (5.24d)$$

Furthermore, in [3] we obtained continued fractions for multivariate polynomials enumerating D-permutations, which by specializing some variables to zero gave continued fractions enumerating D-semiderangements and D-derangements; furthermore, by extracting the coefficient of $\lambda^1$ in a cycle-counting result, we obtained continued fractions enumerating D-cycles. It would be nice to have analogous results in the present context.

# 6 Alternating Laguerre digraphs

We now place permutations in a more general context: that of Laguerre digraphs. Recall from the Introduction that a **Laguerre digraph** [2, 17, 29] is a digraph in which each vertex has out-degree 0 or 1 and in-degree 0 or 1. For each integer $n \ge 0$, let us write $\text{LD}_n$ for the set of Laguerre digraphs on the vertex set $[n] \stackrel{\text{def}}{=} \{1, \dots, n\}$; and for $n \ge k \ge 0$, let us write $\text{LD}_{n,k}$ for the set of Laguerre digraphs on the vertex set $[n]$ with $k$ paths. A Laguerre digraph with no paths is simply a collection of directed cycles, i.e. the digraph associated to a permutation $\sigma \in \mathfrak{S}_n$ [33, pp. 22–23]. There is thus a natural bijection $\text{LD}_{n,0} \simeq \mathfrak{S}_n$.

The study of Laguerre digraphs $\text{LD}_{n,k}$ thus generalizes the study of permutations $\text{LD}_{n,0} \simeq \mathfrak{S}_n$. In a similar way, we will define a class of alternating Laguerre digraphs $\text{LD}_{n,k}^{\text{alt}}$ so as to generalize the study of cycle-alternating permutations $\text{LD}_{n,0}^{\text{alt}} \simeq \mathfrak{S}_n^{\text{ca}}$. Just as $\mathfrak{S}_n^{\text{ca}} \neq \emptyset$ only for $n$ even, we will see that $\text{LD}_{n,k}^{\text{alt}} \neq \emptyset$ only for $n+k$ even.
We begin (Section 6.1) by deriving an exponential generating function for Laguerre digraphs with a very general set of weights [2]. Then (Section 6.2) we define alternating Laguerre digraphs and specialize to obtain their exponential generating function. Next (Section 6.3) we obtain the generalized Jacobi–Rogers and Stieltjes–Rogers polynomials associated to the secant power polynomials, using exponential generating functions. Then (Section 6.4) we obtain the generalized Stieltjes–Rogers polynomials associated to the second master S-fraction for cycle-alternating permutations [eqns. (5.9)/(5.10)], using combinatorial methods. Finally (Section 6.5) we specialize this latter result to obtain the generalized Stieltjes-Rogers polynomials corresponding to the S-fractions of Theorems 5.1 and 5.2.

## 6.1 Exponential generating function for Laguerre digraphs

Before defining our statistics on Laguerre digraphs, we first need to make a convention about *boundary conditions* at the two ends of a path. We will here use 0–0 boundary conditions: that is, we extend the Laguerre digraph $G$ on the vertex set $[n]$ to a digraph $\tilde{G}$ on the vertex set $[n] \cup \{0\}$ by decreeing that any vertex $i \in [n]$ that has in-degree (resp. out-degree) 0 in $G$ will receive an incoming (resp. outgoing) edge from (resp. to) the vertex 0. In this way each vertex $i \in [n]$ will have a unique predecessor $p(i) \in [n] \cup \{0\}$ and a unique successor $s(i) \in [n] \cup \{0\}$. We then say that a vertex $i \in [n]$ is a

* peak (p) if $p(i) < i > s(i)$;

* valley (v) if $p(i) > i < s(i)$;

* double ascent (da) if $p(i) < i < s(i)$;

* double descent (dd) if $p(i) > i > s(i)$;

* fixed point (fp) if $p(i) = i = s(i)$.

(Note that “fixed point” is a synonym of “loop”.) When these concepts are applied to the cycles of a Laguerre digraph, we obtain the usual *cycle classification* of indices in a permutation as cycle peaks, cycle valleys, cycle double rises, cycle double falls and fixed points [31,38]. When applied to the paths of a Laguerre digraph, we obtain the usual *linear classification* of indices in a permutation (written in word form) as peaks, valleys, double ascents or double descents [33, p. 45]. Note that, because of the 0–0 boundary conditions, an isolated vertex is always a peak, the initial vertex of a path is always a peak or double ascent, and the final vertex of a path is always a peak or double descent; moreover, each path contains at least one peak.

We write $p(G)$, $v(G)$, $da(G)$, $dd(G)$, $fp(G)$ for the number of vertices $i \in [n]$ that are, respectively, peaks, valleys, double ascents, double descents or fixed points. We then introduce the *multivariate Laguerre coefficient matrix*

$$ \hat{L}^{(\alpha)}(y_p, y_v, y_{da}, y_{dd}, y_{fp})_{n,k} \stackrel{\text{def}}{=} \sum_{G \in \mathbf{LD}_{n,k}} y_p^{p(G)} y_v^{v(G)} y_{da}^{da(G)} y_{dd}^{dd(G)} y_{fp}^{fp(G)} (1+\alpha)^{\text{cyc}(G)}. \quad (6.1) $$

This polynomial is homogeneous of degree $n$ in $y_p, y_v, y_{da}, y_{dd}, y_{fp}$. (The weight per cycle is here written as $1 + \alpha$ instead of $\lambda$ because these polynomials generalize the Laguerre polynomials with parameter $\alpha$.)
Indeed, we can go farther, by assigning different weights for the vertices belonging to a cycle or to a path. For a Laguerre digraph $G$, let us write pcyc($G$), vcyc($G$), dacyc($G$), ddcyc($G$), fp($G$) for the number of peaks, valleys, double ascents, double descents and fixed points that belong to a cycle of $G$, and ppa($G$), vpa($G$), dapa($G$), ddpa($G$) for the number of peaks, valleys, double ascents and double descents that belong to a path of $G$ (of course fixed points can only belong to a cycle). We then assign weights $y_p, y_v, y_{da}, y_{dd}, y_{fp}$ to the vertices belonging to a cycle, and weights $z_p, z_v, z_{da}, z_{dd}$ to the vertices belonging to a path. We therefore define the generalized multivariate Laguerre coefficient matrix

$$ \tilde{L}^{(\alpha)}(y_p, y_v, y_{da}, y_{dd}, y_{fp}, z_p, z_v, z_{da}, z_{dd})_{n,k} \\ \stackrel{\text{def}}{=} \sum_{G \in \mathbf{LD}_{n,k}} y_p^{\text{pcyc}(G)} y_v^{\text{vcyc}(G)} y_{da}^{\text{dacyc}(G)} y_{dd}^{\text{ddcyc}(G)} y_{fp}^{\text{fp}(G)} z_p^{\text{ppa}(G)} z_v^{\text{vpa}(G)} z_{da}^{\text{dapa}(G)} z_{dd}^{\text{ddpa}(G)} \times \\ (1 + \alpha)^{\text{cyc}(G)}. \qquad (6.2) $$

This polynomial is homogeneous of degree $n$ in $y_p, y_v, y_{da}, y_{dd}, y_{fp}, z_p, z_v, z_{da}, z_{dd}$.

We now proceed to compute the exponential generating functions for the matrices (6.2). We do this by combining the known exponential generating functions for permutations with cyclic statistics [38, Théorème 1] and permutations with linear statistics [38, Proposition 4]. These formulae are as follows:

1) Permutations with cyclic statistics are enumerated by the polynomials

$$ P_n^{\text{cyc}}(y_p, y_v, y_{da}, y_{dd}, y_{fp}, \lambda) \stackrel{\text{def}}{=} \sum_{\sigma \in \mathfrak{S}_n} y_p^{\text{pcyc}(\sigma)} y_v^{\text{vcyc}(\sigma)} y_{da}^{\text{dacyc}(\sigma)} y_{dd}^{\text{ddcyc}(\sigma)} y_{fp}^{\text{fp}(\sigma)} \lambda^{\text{cyc}(\sigma)} \quad (6.3) $$

where pcyc($\sigma$), vcyc($\sigma$), dacyc($\sigma$), ddcyc($\sigma$), fp($\sigma$) denote the number of cycle peaks, cycle valleys, cycle double rises, cycle double falls and fixed points in $\sigma$, and cyc($\sigma$) denotes the number of cycles in $\sigma$. By convention we set $P_0^{\text{cyc}} = 1$. The polynomial $P_n^{\text{cyc}}$ is homogeneous of degree $n$ in $y_p, y_v, y_{da}, y_{dd}, y_{fp}$. We write

$$ F(t; y_p, y_v, y_{da}, y_{dd}, y_{fp}, \lambda) \stackrel{\text{def}}{=} \sum_{n=0}^{\infty} P_n^{\text{cyc}}(y_p, y_v, y_{da}, y_{dd}, y_{fp}, \lambda) \frac{t^n}{n!} \quad (6.4) $$

for the corresponding exponential generating function.

**Lemma 6.1.** [38, Théorème 1] We have

$$ F(t; y_p, y_v, y_{da}, y_{dd}, y_{fp}, \lambda) = e^{\lambda y_{fp} t} \left( \frac{r_1 - r_2}{r_1 e^{r_2 t} - r_2 e^{r_1 t}} \right)^{\lambda} \quad (6.5a) $$

$$ = F(t; y_p, y_v, y_{da}, y_{dd}, y_{fp}, 1)^{\lambda} \quad (6.5b) $$

where $r_1r_2 = y_p y_v$ and $r_1 + r_2 = y_{da} + y_{dd}$. Otherwise put, $r_1$ and $r_2$ are the roots (in either order) of the quadratic equation $\rho^2 - (y_{da} + y_{dd})\rho + y_p y_v = 0$. Concretely,

$$ r_{1,2} = \frac{y_{da} + y_{dd} \pm \sqrt{(y_{da} + y_{dd})^2 - 4y_p y_v}}{2}. \quad (6.6) $$
2) Permutations with linear statistics and 0–0 boundary conditions are enumerated by the polynomials

$$P_n^{\text{lin}(00)}(z_p, z_v, z_{\text{da}}, z_{\text{dd}}) \stackrel{\text{def}}{=} \sum_{\sigma \in \mathfrak{S}_n} z_p^{\text{ppa}(\sigma)} z_v^{\text{vpa}(\sigma)} z_{\text{da}}^{\text{dapa}(\sigma)} z_{\text{dd}}^{\text{ddpa}(\sigma)} \quad (6.7)$$

where ppa($\sigma$), vpa($\sigma$), dapa($\sigma$), ddpa($\sigma$) denote the number of peaks, valleys, double ascents and double descents in the permutation $\sigma$ written as a word $\sigma_1 \cdots \sigma_n$, where we impose the boundary conditions $\sigma_0 = \sigma_{n+1} = 0$. By convention we restrict attention to $n \ge 1$. The polynomial $P_n^{\text{lin}(00)}$ is homogeneous of degree $n$ in $z_p, z_v, z_{\text{da}}, z_{\text{dd}}$. We write

$$G(t; z_p, z_v, z_{\text{da}}, z_{\text{dd}}) \stackrel{\text{def}}{=} \sum_{n=1}^{\infty} P_n^{\text{lin}(00)}(z_p, z_v, z_{\text{da}}, z_{\text{dd}}) \frac{t^n}{n!} \quad (6.8)$$

for the corresponding exponential generating function (note that the sum starts at $n = 1$).

**Lemma 6.2.** [38, Proposition 4] We have

$$G(t; z_p, z_v, z_{\text{da}}, z_{\text{dd}}) = z_p \left( \frac{e^{r_1 t} - e^{r_2 t}}{r_1 e^{r_2 t} - r_2 e^{r_1 t}} \right) \quad (6.9)$$

where $r_1r_2 = z_pz_v$ and $r_1 + r_2 = z_{\text{da}} + z_{\text{dd}}$ analogously to Lemma 6.1. This function satisfies the differential equation

$$G'(t) = z_p + (z_{\text{da}} + z_{\text{dd}})G(t) + z_v G(t)^2. \quad (6.10)$$

We can now put these ingredients together to determine the exponential generating functions for the matrix (6.2). A Laguerre digraph $G \in \mathbf{LD}_{n,k}$ consists of a permutation (that is, a collection of disjoint cycles) on some subset $S \subseteq [n]$ together with $k$ disjoint paths on $[n] \setminus S$. Each of these paths can be considered as a permutation written in word form. By the exponential formula, the exponential generating function for the $k$th column of the matrix (6.2) is then

$$\sum_{n=0}^{\infty} \tilde{L}^{(\alpha)}(y_p, y_v, y_{\text{da}}, y_{\text{dd}}, y_{\text{fp}}, z_p, z_v, z_{\text{da}}, z_{\text{dd}})_{n,k} \frac{t^n}{n!} \\ = F(t; y_p, y_v, y_{\text{da}}, y_{\text{dd}}, y_{\text{fp}}, 1)^{1+\alpha} \frac{G(t; z_p, z_v, z_{\text{da}}, z_{\text{dd}})^k}{k!}, \quad (6.11)$$

where the $1/k!$ comes because the paths are indistinguishable. The bivariate exponential generating function is therefore

$$\sum_{n=0}^{\infty} \sum_{k=0}^{n} \tilde{L}^{(\alpha)}(y_p, y_v, y_{\text{da}}, y_{\text{dd}}, y_{\text{fp}}, z_p, z_v, z_{\text{da}}, z_{\text{dd}})_{n,k} \frac{t^n}{n!} u^k \\ = F(t; y_p, y_v, y_{\text{da}}, y_{\text{dd}}, y_{\text{fp}}, 1)^{1+\alpha} \exp[u G(t; z_p, z_v, z_{\text{da}}, z_{\text{dd}})]. \quad (6.12)$$
## 6.2 Alternating Laguerre digraphs

We define an alternating Laguerre digraph to be a Laguerre digraph in which there are no double ascents, double descents or fixed points. It follows that all the cycles are of even length and consist of cycle peaks and cycle valleys in alternation. Furthermore, since we are using 0-0 boundary conditions, all the paths are of odd length and consist of peaks and valleys in alternation, starting and ending with a peak: $0 < x_1 > x_2 < x_3 > \dots < x_{2m+1} > 0$. That is, the paths are simply alternating (down-up) permutations [32] of odd length written in word form: $x_1 > x_2 < x_3 > \dots < x_{2m+1}$. We write $LD_{n,k}^{\text{alt}}$ for the set of alternating Laguerre digraphs on the vertex set $[n]$ with $k$ paths. Since each path has odd length and each cycle has even length, it follows that $LD_{n,k}^{\text{alt}} \neq \emptyset$ only if $n+k$ is even. We have the obvious bijection $LD_{n,0}^{\text{alt}} \simeq \mathcal{S}_n^{\text{ca}}$. In this way, alternating Laguerre digraphs generalize cycle-alternating permutations, to which they reduce when $k=0$.

We define a generating polynomial for alternating Laguerre digraphs by specializing the one for Laguerre digraphs to forbid double ascents, double descents and fixed points:

$$ \tilde{\mathcal{L}}^{(\alpha)\text{alt}}(y_p, y_v, z_p, z_v)_{n,k} \stackrel{\text{def}}{=} \tilde{\mathcal{L}}^{(\alpha)}(y_p, y_v, 0, 0, 0, z_p, z_v, 0, 0)_{n,k} \quad (6.13a) $$

$$ = \sum_{G \in \mathcal{LD}_{n,k}^{\text{alt}}} y_p^{\text{pcyc}(G)} y_v^{\text{vcyc}(G)} z_p^{\text{ppa}(G)} z_v^{\text{vpa}(G)} \times (1 + \alpha)^{\text{cyc}(G)}. \quad (6.13b) $$

This polynomial is homogeneous of degree $n$ in $y_p, y_v, z_p, z_v$.

Specializing Lemma 6.1 to $y_{\text{da}} = y_{\text{dd}} = y_{\text{fp}} = 0$, we have $r_1 = +i\sqrt{y_p y_v}$ and $r_2 = -i\sqrt{y_p y_v}$, hence

$$ F(t; y_p, y_v, 0, 0, 0, \lambda) = [\sec(\sqrt{y_p y_v} t)]^\lambda. \quad (6.14) $$

Similarly, specializing Lemma 6.2 to $z_{\text{da}} = z_{\text{dd}} = 0$, we have

$$ G(t; z_p, z_v, 0, 0) = \sqrt{z_p/z_v} \tan(\sqrt{z_p z_v} t). \quad (6.15) $$

Therefore, the exponential generating function for the $k$th column of the matrix (6.13) is

$$ \sum_{n=0}^{\infty} \tilde{\mathcal{L}}^{(\alpha)\text{alt}}(y_p, y_v, z_p, z_v)_{n,k} \frac{t^n}{n!} = [\sec(\sqrt{y_p y_v} t)]^{1+\alpha} \frac{[\sqrt{z_p/z_v} \tan(\sqrt{z_p z_v} t)]^k}{k!}. $$

In order to make the connection with continued fractions, we will want to give path vertices and cycle vertices the same weights, i.e. $z_p = y_p$ and $z_v = y_v$. Once we have made this specialization, there is no loss of generality in taking $y_p = y_v = 1$, since those variables would simply make a trivial rescaling. We therefore have

$$ \sum_{n=0}^{\infty} \tilde{\mathcal{L}}^{(\alpha)\text{alt}}(1, 1, 1, 1)_{n,k} \frac{t^n}{n!} = (\sec t)^{1+\alpha} \frac{(\tan t)^k}{k!}. \quad (6.16) $$
In particular, the zeroth column $\tilde{\mathbf{L}}^{(\alpha)\text{alt}}(1, 1, 1, 1)_{n,0}$ has the **secant power polynomials** at even $n$ and zero entries at odd $n$, where the secant power polynomials are defined by

$$ (\sec t)^{\lambda} = \sum_{n=0}^{\infty} E_{2n}(\lambda) \frac{t^{2n}}{(2n)!}. \qquad (6.17) $$

The first 8 rows and columns of the matrix $\tilde{\mathbf{L}}^{(\alpha)\text{alt}}(1, 1, 1, 1)$ (written for simplicity in terms of $\lambda = 1 + \alpha$) are

$$ \left[ \begin{array}{ccccccc} 1 & & & & & & \\ 0 & 1 & & & & & \\ \lambda & 0 & 1 & & & & \\ 0 & 2+3\lambda & 0 & 1 & & & \\ 2\lambda+3\lambda^2 & 0 & 8+6\lambda & 0 & 1 & & \\ 0 & 16+30\lambda+15\lambda^2 & 0 & 20+10\lambda & 0 & 1 & \\ 16\lambda+30\lambda^2+15\lambda^3 & 0 & 136+150\lambda+45\lambda^2 & 0 & 40+15\lambda & 0 & 1 \\ 0 & 272+588\lambda+420\lambda^2+105\lambda^3 & 0 & 616+490\lambda+105\lambda^2 & 0 & 70+21\lambda & 0 & 1 \end{array} \right] \qquad (6.18) $$

## 6.3 Continued fraction for secant power polynomials

Following Stieltjes [34] and Rogers [26], we can use Rogers' addition formula (Theorem 2.2 above) to obtain the continued fraction for the secant power polynomials. From the high-school angle-addition formula

$$ \cos(t+u) = (\cos t)(\cos u) - (\sin t)(\sin u) \qquad (6.19a) $$

$$ = (\cos t)(\cos u) [1 - (\tan t)(\tan u)] \qquad (6.19b) $$

we obtain

$$ [\sec(t+u)]^{\lambda} = (\sec t)^{\lambda} (\sec u)^{\lambda} \sum_{k=0}^{\infty} \binom{\lambda+k-1}{k} (\tan t)^k (\tan u)^k, \qquad (6.20) $$

which is of the form $(2.10)/(2.11)$ with

$$ \beta_k = k(\lambda + k - 1), \qquad F_k(t) = \frac{(\sec t)^\lambda (\tan t)^k}{k!} = \frac{t^k}{k!} + O(t^{k+2}), \qquad (6.21) $$

so that $\mu_k = 0$ and hence $\gamma_k = 0$. Theorem 2.2 then implies that the ordinary generating function of the secant power polynomials is given by the J-fraction

$$ \sum_{n=0}^{\infty} E_{2n}(\lambda) t^{2n} = \frac{1}{1 - \frac{1 \cdot \lambda t^2}{1 - \frac{2(\lambda + 1)t^2}{1 - \frac{3(\lambda + 2)t^2}{1 - \dots}}}}. \qquad (6.22) $$

After renaming $t^2 \to t$, this is actually an S-fraction with coefficients $\alpha_n = n(\lambda+n-1)$. So far, this is all well known. And comparing (6.22) with Theorem 5.1, we see that $E_{2n}(\lambda)$ enumerates cycle-alternating permutations of $[2n]$ with a weight $\lambda$ for each cycle.
But Theorem 2.2 gives more: it tells us that $F_k(t) = (\sec t)^\lambda (\tan t)^k/k!$ is the exponential generating function for the $k$th column of the generalized Jacobi–Rogers matrix $J = (J_{n,k}(\beta, \gamma))_{n,k \ge 0}$ with $\beta_n = n(\lambda + n - 1)$ and $\gamma = 0$. On the other hand, we know from (6.16) that this $F_k(t)$ is precisely the exponential generating function for alternating Laguerre digraphs with $k$ paths, $\tilde{L}^{(\alpha)\text{alt}}(1, 1, 1, 1)_{n,k}$, with $\lambda = 1 + \alpha$:

$$ \tilde{L}^{(\alpha)\text{alt}}(1, 1, 1, 1)_{n,k} = \left[ \frac{t^n}{n!} \right] \frac{(\sec t)^{1+\alpha} (\tan t)^k}{k!} . \qquad (6.23) $$

We have therefore shown:

**Proposition 6.3.** The generalized Jacobi–Rogers polynomial $J_{n,k}(\beta, \gamma)$ with $\beta_n = n(n + \alpha)$ and $\gamma = 0$ enumerates alternating Laguerre digraphs on $[n]$ with $k$ paths with a weight $1 + \alpha$ for each cycle.

By extracting the submatrices $(2n, 2k)$ and $(2n + 1, 2k + 1)$ using (2.18), we can equivalently obtain the generalized Stieltjes–Rogers polynomials $S_{n,k}(\alpha)$ and $S'_{n,k}(\alpha)$ with $\alpha_n = n(n + \alpha)$:

$$ S_{n,k}(\alpha) = \left[ \frac{t^{2n}}{(2n)!} \right] \frac{(\sec t)^{1+\alpha} (\tan t)^{2k}}{(2k)!} \qquad (6.24a) $$

$$ S'_{n,k}(\alpha) = \left[ \frac{t^{2n+1}}{(2n+1)!} \right] \frac{(\sec t)^{1+\alpha} (\tan t)^{2k+1}}{(2k+1)!} \qquad (6.24b) $$

**Corollary 6.4.** The generalized Stieltjes–Rogers polynomial $S_{n,k}(\alpha)$ [resp. $S'_{n,k}(\alpha)$] with $\alpha_n = n(n + \alpha)$ enumerates alternating Laguerre digraphs on $[2n]$ with $2k$ paths [resp. on $[2n + 1]$ with $2k + 1$ paths] with a weight $1 + \alpha$ for each cycle.

## 6.4 Generalized Stieltjes–Rogers polynomials for the second master S-fraction

We now propose to show how the generalized Stieltjes–Rogers polynomials of the first and second kinds for the second master S-fraction for cycle-alternating permutations, $(5.9)/(5.10)$, can be understood as generating polynomials for alternating Laguerre digraphs. This will lead to a far-reaching generalization of Proposition 6.3 and Corollary 6.4, and at the same time of [31, Theorem 2.23].

To do this, it is convenient to use a different convention about the *boundary conditions* at the two ends of a path of a Laguerre digraph. Namely, we will here use $\infty-\infty$ (rather than 0–0) boundary conditions: that is, we extend the Laguerre digraph $G$ on the vertex set $[n]$ to a digraph $\hat{G}$ on the vertex set $[n] \cup \{\infty\}$ by decreeing that any vertex $i \in [n]$ that has in-degree (resp. out-degree) 0 in $G$ will receive an incoming (resp. outgoing) edge from (resp. to) the vertex $\infty$. However, our definitions of peak, valley, double ascent, double descent and fixed point will be the same as before. Note that, because of the $\infty-\infty$ boundary conditions, an isolated vertex is always a valley, the initial vertex of a path is always a valley or double descent, and the final vertex of a path is always a valley or double ascent; moreover, each path contains at least one valley. We also recall that, for a given vertex $i \in [n]$, we use $p(i)$ to denote its
predecessor in $\hat{G}$, and $s(i)$ to denote its successor. Later we will explain why we have found it convenient to use $\infty$-$\infty$ boundary conditions.

With these boundary conditions, an alternating Laguerre digraph will still have cycles of even length with cycle peaks and cycle valleys in alternation, and paths of odd length consisting of peaks and valleys in alternation. However, the paths will start and end with a valley: $\infty > x_1 < x_2 > x_3 < \dots > x_{2m+1} < \infty$. The paths are now alternating (up-down) permutations of odd length written in word form: $x_1 < x_2 > x_3 < \dots > x_{2m+1}$. We write $\mathbf{LD}_{n,k}^{\infty}$ for the set of alternating Laguerre digraphs on the vertex set $[n]$ with $k$ paths using $\infty$-$\infty$ boundary conditions. Of course, there is a natural bijection between $\mathbf{LD}_{n,k}^{\infty}$ and $\mathbf{LD}_{n,k}^{\infty}$, by mapping vertices $i \mapsto n+1-i$.

Now we shall define some new statistics on Laguerre digraphs which extend the crossing and nesting statistics on permutations that were defined in Section 3.2. We say that a quadruplet $1 \le i < j < k < l \le \infty$ forms a

* lower crossing (lcross) if $p(i) = k$ and $p(j) = l$;

* lower nesting (lnest) if $p(j) = k$ and $p(i) = l$.

Notice that in such a quadruplet, the vertex $k$ must be either a peak or a double descent. When $l < \infty$, these conditions could equivalently be written in terms of the successor function: a quadruplet is a lower crossing if $i = s(k)$ and $j = s(l)$, and a lower nesting if $j = s(k)$ and $i = s(l)$. But we have written them in terms of the predecessor function in order to handle smoothly the case $l = \infty$, i.e. the case when $j$ (resp. $i$) has in-degree 0 in $G$. This definition now allows us to define the index-refined lower crossing and nesting statistics for Laguerre digraphs, as a generalization of (3.6c,d):

$$ \text{lcross}(k, G) = \#\{1 \le i < j < k < l \le \infty: p(i) = k \text{ and } p(j) = l\} \quad (6.25a) $$

$$ \text{lnest}(k, G) = \#\{1 \le i < j < k < l \le \infty: p(j) = k \text{ and } p(i) = l\} \quad (6.25b) $$

Note that because these statistics are defined in terms of the index in third position (namely, $k$), we certainly have $k < \infty$ (since $k \in [n]$). When the Laguerre digraph $G$ has no paths and hence arises as the digraph of a permutation $\sigma$, this definition manifestly coincides with the definitions (3.6c,d).

However, things are going to be more subtle for the upper crossings and nestings, because these statistics will be defined [cf. (3.6a,b)] in terms of the index in second position (namely, $j$), and there is then no guarantee that $k < \infty$. Rather, we need to reckon with the possibility that $i < j < k = l = \infty$, and this means that (at least in this case) we will be unable to distinguish between crossings and nestings. We therefore define a new statistic ulev that plays the role of ucross + unest. That is, for $j \in [n]$ we define

$$ \text{ulev}(j, G) = \#\{i < j: j < s(i) \le \infty \text{ and } j < s(j) \le \infty\}. \quad (6.26) $$

We shall say that ulev($j, G$) is the upper level of the vertex $j$. Note that ulev($j, G$) can be nonzero only when $j$ is either a valley or a double ascent. When the Laguerre digraph $G$ has no paths and hence arises as the digraph of a permutation $\sigma$, we have

$$ \text{ulev}(j, G) = \text{ucross}(j, \sigma) + \text{unest}(j, \sigma). \quad (6.27) $$
We can also define analogously a lower level for the vertex k:

$$ \mathrm{llev}(k, G) = \#\{m < k: k < p(m) \le \infty \text{ and } s(k) < k\}. \quad (6.28) $$

But this definition is superfluous, because it is concocted to satisfy

$$ \mathrm{llev}(k, G) = \mathrm{lcross}(k, G) + \mathrm{lnest}(k, G); \quad (6.29) $$

to see this it suffices to look at the two cases $m = i$ (nesting) and $m = j$ (crossing).

We now restrict attention to alternating Laguerre digraphs, and define a generating polynomial in two infinite families of indeterminates $\mathbf{a} = (\mathbf{a}_\ell)_{\ell \ge 0}$ and $\mathbf{b} = (\mathbf{b}_\ell, \ell')_{\ell, \ell' \ge 0}$ that uses the crossing, nesting and level statistics:

$$ \tilde{Q}_{n,k}(\mathbf{a}, \mathbf{b}, \lambda) = \sum_{G \in \mathbf{L}\mathbf{D}_{n,k}^{\mathrm{alt},\infty}} \lambda^{\mathrm{cyc}(G)} \prod_{i \in \mathrm{Val}(G)} \mathbf{a}_{\mathrm{ulev}(i,G)} \prod_{i \in \mathrm{Peak}(G)} \mathbf{b}_{\mathrm{lcross}(i,G), \mathrm{lnest}(i,G)} \quad (6.30) $$

where $\mathrm{Val}(G)$ denotes the set of valleys of $G$ and $\mathrm{Peak}(G)$ denotes the set of peaks of $G$. For $k = 0$, we have $\mathbf{L}\mathbf{D}_{2n,0}^{\mathrm{alt}} \simeq \mathfrak{S}_{2n}^{\mathrm{ca}}$, i.e. an alternating Laguerre digraph $G$ with no paths is the digraph of a cycle-alternating permutation $\sigma$, and we have

$$ \tilde{Q}_{2n,0} = \hat{Q}_n \quad (6.31) $$

where $\hat{Q}_n$ is the second master polynomial for cycle-alternating permutations defined in (5.8) [31, (2.137)]. We therefore call $\tilde{Q}_{n,k}(\mathbf{a}, \mathbf{b}, \lambda)$ the second master polynomial for alternating Laguerre digraphs.

Recall that there is a natural bijection between $\mathbf{L}\mathbf{D}_{n,k}^{\mathrm{alt},\infty}$ and $\mathbf{L}\mathbf{D}_{n,k}^{\mathrm{alt}}$ by mapping vertices $i \mapsto n + 1 - i$. This bijection sends cycle peaks to cycle valleys, path peaks to path valleys, and vice-versa. Thus, under the specializations $\mathbf{a}_\ell = y_\ell$, $\mathbf{b}_{\ell, \ell'} = y_\ell$ and $\lambda = 1 + \alpha$, the polynomial $\tilde{Q}_{n,k}(\mathbf{a}, \mathbf{b}, \lambda)$ is equal to the polynomial $\tilde{\mathbf{L}}^{(\alpha)\mathrm{alt}}(y_\ell, y_\ell, y_\ell, y_\ell)_{n,k}$ obtained by substituting $y_\ell = z_\ell$ to $y_\ell$ and $y_\ell = z_\ell$ to $y_\ell$ in (6.13).

The main technical result of this subsection is that the polynomials $\tilde{Q}_{n,k}(\mathbf{a}, \mathbf{b}, \lambda)$ satisfy the following recurrence:

**Proposition 6.5** (Recurrence for second master polynomial for alternating Laguerre digraphs). The polynomials $\tilde{Q}_{n,k}(\mathbf{a}, \mathbf{b}, \lambda)$ defined in (6.30) satisfy the recurrence

$$ \tilde{Q}_{n+1,k} = \mathbf{a}_{k-1} \tilde{Q}_{n,k-1} + (\lambda + k) \left( \sum_{i=0}^{k} \mathbf{b}_{i,k-i} \right) \tilde{Q}_{n,k+1}. \quad (6.32) $$

**PROOF.** In order to prove the recurrence (6.32), we first start with an alternating Laguerre digraph $G \in \mathbf{L}\mathbf{D}_{n+1,k}^{\mathrm{alt},\infty}$. We then look at the status of the vertex $n+1$, and for each possibility we consider the induced subgraph on the vertex set $[n]$, call it $G'$. (Clearly $G'$ is a Laguerre digraph; we will also see that it is alternating, but that takes a bit more work to prove.) For each situation, we then count the number of the ways in which $n+1$ could be inserted into $G'$, and evaluate what this does to the weights.
Let us begin by observing that, for every $i \in [n]$,

$$ \mathrm{lcross}(i, G) = \mathrm{lcross}(i, G') \qquad (6.33\mathrm{a}) $$

$$ \mathrm{lnest}(i, G) = \mathrm{lnest}(i, G') \qquad (6.33\mathrm{b}) $$

$$ \mathrm{ulev}(i, G) = \mathrm{ulev}(i, G') \qquad (6.33\mathrm{c}) $$

This is because, if the predecessor (resp. successor) of $i$ in $G$ is $n+1$, then its predecessor (resp. successor) in $G'$ is $\infty$; and in the inequalities defining $\mathrm{lcross}$, $\mathrm{lnest}$, $\mathrm{ulev}$, the values $n+1$ and $\infty$ play identical roles. (That is why we have chosen here to use $\infty-\infty$ boundary conditions.) It follows that all vertices $i \in [n]$ get the same weight $\mathbf{a}_\ell$ or $\mathbf{b}_{\ell,\ell'}$ in $G$ as they do in $G'$. Therefore, we only need to worry about the weight associated to the vertex $n+1$, as well as the possible change in the number of cycles.

We begin by considering the case when $n+1$ is a valley. For this to happen, we must have $p(n+1) = s(n+1) = \infty$; in other words, $n+1$ is an isolated vertex in $G$. Removing $n+1$, we see that the resulting digraph $G'$ has $k-1$ paths and is alternating. On the other hand if we begin with an alternating Laguerre digraph $G' \in \mathbf{LD}^{\infty}_{n,k-1}$, there is exactly one way in which the vertex $n+1$ can be inserted into $G'$ as an isolated vertex. Note that, in $G$, the vertex $n+1$ has upper level $\mathrm{ulev}(n+1, G) = k-1$: this is because, in (6.26) with $j = n+1$, we have $s(j) = \infty$ (because $j = n+1$ is a valley), and the contributing vertices $i$ are those that have $s(i) = \infty$; this happens when (and only when) $i (\neq j)$ is the end vertex of a path, and there are $k-1$ such paths. Therefore, the vertex $n+1$ gets a weight $\mathbf{a}_{k-1}$ in its contribution to $\tilde{Q}_{n+1,k}$. Therefore, the cases in which $n+1$ is a valley contribute the summand $\mathbf{a}_{k-1} \tilde{Q}_{n,k-1}$.

When $n+1$ is a peak, its predecessor $p(n+1)$ and successor $s(n+1)$ lie in $[n]$; therefore, it cannot be the initial or final vertex of a path in $G$. If $n+1$ is a peak belonging to a cycle of $G$, then removing it turns its component into a path and increases the number of paths by 1. If $n+1$ is a peak belonging to a path of $G$ (and hence an internal vertex of that path), removing it causes that path to be divided into two nonempty paths, and hence again increases the number of paths by 1. In both cases the resulting Laguerre digraph $G'$ will be alternating, because the vertices that had $n+1$ as predecessor or successor in $G$ will now have $\infty$ as their predecessor or successor in $G'$, maintaining the required inequalities. Hence $G' \in \mathbf{LD}^{\infty}_{n,k+1}$.

We now begin with an alternating Laguerre digraph $G' \in \mathbf{LD}^{\infty}_{n,k+1}$, and count the number of ways in which $n+1$ can be inserted as peak. To do this, we need to count the various possibilities in which the predecessor and successor of $n+1$ can be chosen. The successor of $n+1$ can be chosen from any of the $k+1$ initial vertices of the paths. Let $1 \le f_0 < f_1 < \dots < f_k \le n$ be the initial vertices of the paths of $G'$, ordered in increasing order. If $s(n+1) = f_i$, any resulting alternating Laguerre digraph $G$ will have $p(f_j) = \infty$ for all $j \neq i$. In particular, for all $j < i$, the quadruplets $f_j < f_i < n+1 < \infty$ will be lower nestings; and these will be the only lower nestings with third index $n+1$. Similarly, for all $j > i$, the quadruplets $f_i < f_j < n+1 < \infty$ will be lower crossings; and these will be the only lower crossings with third index $n+1$. Therefore, we will have $\mathrm{lnest}(n+1, G) = i$ and $\mathrm{lcross}(n+1, G) = k-i$. Thus, whenever $s(n+1) = f_i$ ($0 \le i \le k$), the vertex $n+1$ gets weight $\mathbf{b}_{i,k-i}$ in $G$.

The predecessor of $n+1$ can be chosen from any of the $k+1$ final vertices of the paths. However, for each choice of successor $f_i$, there is exactly one choice of
final vertex that forms a cycle (namely, when the successor and predecessor vertices of $n + 1$ are the initial and final vertices of the same path); in this situation we get an additional weight $\lambda$. In the other $k$ cases we get a weight 1. Thus, the case when $n + 1$ is a peak contributes the summand $(\lambda + k) (\sum_{i=0}^{k} b_{i,k-i}) \tilde{Q}_{n,k+1}$. $\square$

The recurrence (6.32) combined with Proposition 2.1 yields:

**Theorem 6.6 (Generalized Jacobi-Rogers polynomials).** *The generalized Jacobi-Rogers polynomial $J_{n,k}(\alpha, 0)$ with weights*

$$ \alpha_n = (\lambda + n - 1)\mathbf{a}_{n-1} \left( \sum_{\ell=0}^{n-1} \mathbf{b}_{\ell,n-1-\ell} \right) \qquad (6.34) $$

[cf. (5.10)] satisfies

$$ \tilde{Q}_{n,k}(\mathbf{a}, \mathbf{b}, \lambda) = \left( \prod_{i=0}^{k-1} \mathbf{a}_i \right) J_{n,k}(\alpha, 0) \qquad (6.35) $$

where $\tilde{Q}_{n,k}(\mathbf{a}, \mathbf{b}, \lambda)$ is defined in (6.30).

Since the J-fraction in Theorem 6.6 has $\gamma = 0$, the even and odd submatrices of $J(\alpha, 0)$ can be interpreted by (2.18) as being the generalized Stieltjes-Rogers polynomials of the first and second kinds for the second master S-fraction for cycle-alternating permutations, $(5.9)/(5.10)$:

**Corollary 6.7 (Generalized Stieltjes-Rogers polynomials).** *With $\alpha$ given by (6.34), we have*

$$ \tilde{Q}_{2n,2k}(\mathbf{a}, \mathbf{b}, \lambda) = \left( \prod_{i=0}^{2k-1} \mathbf{a}_i \right) S_{n,k}(\alpha) \qquad (6.36a) $$

$$ \tilde{Q}_{2n+1,2k+1}(\mathbf{a}, \mathbf{b}, \lambda) = \left( \prod_{i=0}^{2k} \mathbf{a}_i \right) S'_{n,k}(\alpha) \qquad (6.36b) $$

## 6.5 Specialization to the case of Theorems 5.1 and 5.2

By specializing Corollary 6.7, we can obtain the generalized Stieltjes-Rogers polynomials corresponding to the S-fractions of Theorems 5.1 and 5.2. To do this, we will first need to extend the concepts of records and antirecords from permutations to Laguerre digraphs. This extension will be motivated by [31, Lemma 2.10], which we have recalled in Lemma 4.3.

We now extend the concepts of record and antirecord from permutations to arbitrary words in a totally ordered alphabet:

**Definition 6.8.** Let $w_1...w_n$ be a word in a totally ordered alphabet. Then:

(a) $i$ is a record position (and $w_i$ is a record value) in case, for all $j < i$, we have $w_j < w_i$.

(b) $i$ is an antirecord position (and $w_i$ is an antirecord value) in case, for all $j > i$, we have $w_j > w_i$.
When the word $w_1 \dots w_n$ is a permutation of $[n]$, these concepts are connected as
follows:

**Lemma 6.9.** Let $\sigma$ be a permutation of $[n]$, and let $\sigma^{-1}$ be the inverse permutation.
Then:

(a) $i$ is a record position in the word $\sigma(1) \dots \sigma(n)$ if and only if $i$ is an antirecord value in the word $\sigma^{-1}(1) \dots \sigma^{-1}(n)$.

(b) $i$ is an antirecord position in the word $\sigma(1) \dots \sigma(n)$ if and only if $i$ is a record value in the word $\sigma^{-1}(1) \dots \sigma^{-1}(n)$.

**PROOF.** (a) By definition, $i$ is a record position in the word $\sigma(1) \dots \sigma(n)$ in case the following holds true: whenever $j < i$, we have $\sigma(j) < \sigma(i)$. Similarly, $i$ is an antirecord value in the word $\sigma^{-1}(1) \dots \sigma^{-1}(n)$ in case the following holds true: whenever $k > \sigma(i)$, we have $\sigma^{-1}(k) > i$. Defining $j = \sigma^{-1}(k)$, this latter statement can be rewritten as: whenever $\sigma(j) > \sigma(i)$, we have $j > i$. For each pair $i \neq j$, the third statement is the contrapositive of the first.

(b) The proof is similar. $\square$

Using Lemma 6.9, we can rewrite Lemma 4.3 as follows:

**Lemma 6.10.** Let $\sigma$ be a permutation.

(a) If $i$ is a cycle valley or cycle double rise, then $i$ is an antirecord value in the word $\sigma^{-1}(1) \dots \sigma^{-1}(n)$ if and only if unest($i$, $\sigma$) = 0.

(b) If $i$ is a cycle peak or cycle double fall, then $i$ is a record value in the word $\sigma^{-1}(1) \dots \sigma^{-1}(n)$ if and only if lnest($i$, $\sigma$) = 0.

We now generalize Lemma 6.10(b) from permutations to Laguerre digraphs. To do this, we first observe that to any Laguerre digraph $G$ on the vertex set $[n]$, we can associate a **predecessor word** $p(1) \dots p(n)$ and a **successor word** $s(1) \dots s(n)$, each taking values in the totally ordered alphabet $[n] \cup \{\infty\}$. Of course, if $G$ is the digraph associated to a permutation $\sigma$, then the predecessor word is $\sigma^{-1}(1) \dots \sigma^{-1}(n)$ and the successor word is $\sigma(1) \dots \sigma(n)$, which of course take values in $[n]$. We then have the following generalization of Lemma 6.10(b):

**Lemma 6.11.** Let $G$ be a Laguerre digraph on the vertex set $[n]$. If $k$ is a peak or double descent, then $k$ is a record value in the predecessor word $p(1) \dots p(n)$ if and only if lnest($k$, $G$) = 0.

**PROOF.** Since $k$ is a peak or double descent, we have $s(k) < k < \infty$. Therefore, $k$ has out-degree 1 in $G$. It follows that the letter $k$ occurs exactly once in the predecessor word $p(1) \dots p(n)$: namely, $k = p(j)$ if and only if $j = s(k)$.

By definition, $k$ is a record value in the predecessor word $p(1) \dots p(n)$ in case, for all $i < s(k)$, we have $p(i) < k$. Equivalently, $k$ is a record value in the predecessor word $p(1) \dots p(n)$ in case there does not exist $i < s(k)$ such that $p(i) > k$ (equality $p(i) = k$ is excluded because it would imply $i = s(k)$). But, by the definition (6.25b) of lnest, this is precisely the statement that $lnest(k, G) = 0$. $\square$
With these preliminaries, we are now able to state the generalized Stieltjes–Rogers polynomials corresponding to the S-fractions of Theorems 5.1 and 5.2. Let us start with Theorem 5.1, which concerns the polynomials (5.1) specialized to $y_e = v_e$ and $y_o = v_o$: this means that for cycle peaks (but not for cycle valleys) we are distinguishing between those that are antirecords (i.e. antirecord *positions*) and those that are not. By Lemma 6.9(b), $i$ is an antirecord position in $\sigma$ if and only if $i$ is a record value in $\sigma^{-1}$. We then generalize the latter condition to Laguerre digraphs $G$ on the vertex set $[n]$ by defining

$$ \text{Arecpeak}^*(G) \stackrel{\text{def}}{=} \{i \in [n]: i \in \text{Peak}(G) \text{ and} \\ \qquad i \text{ is a record value in the predecessor word } p(1) \dots p(n)\}, \quad (6.37a) $$

$$ \text{Nrpeak}^*(G) \stackrel{\text{def}}{=} \{i \in [n]: i \in \text{Peak}(G) \text{ and} \\ \qquad i \text{ is not a record value in the predecessor word } p(1) \dots p(n)\}, \quad (6.37b) $$

where we recall that we have defined

$$ \text{Peak}(G) \stackrel{\text{def}}{=} \{i \in [n]: i \text{ is a peak in } G \text{ using } \infty-\infty \text{ boundary conditions}\}, \quad (6.38a) $$

$$ \text{Val}(G) \stackrel{\text{def}}{=} \{i \in [n]: i \text{ is a valley in } G \text{ using } \infty-\infty \text{ boundary conditions}\}. \quad (6.38b) $$

We then define

$$ \text{eareccpeakeven}^*(G) \stackrel{\text{def}}{=} |\text{Arecpeak}^*(G) \cap \text{Even}| \quad (6.39a) $$

$$ \text{nrcpeakeven}^*(G) \stackrel{\text{def}}{=} |\text{Nrpeak}^*(G) \cap \text{Even}| \quad (6.39b) $$

$$ \text{cvaleven}^*(G) \stackrel{\text{def}}{=} |\text{Val}(G) \cap \text{Even}| \quad (6.39c) $$

and likewise for the odd ones. (The names for these quantities are chosen to coincide with the previous ones when $G$ is the digraph arising from a permutation, even though the names may seem a bit bizarre when compared with the actual definitions; we have used a star to stress this change of emphasis.) Having done this, we then extend the definition (5.1), specialized to $y_e = v_e$ and $y_o = v_o$, from permutations to Laguerre digraphs:

$$ \hat{Q}_{n,k}(x_e, y_e, u_e, x_o, y_o, u_o, \lambda) = \sum_{G \in \mathcal{L}^{\infty}_{n,k}} x_e^{\text{eareccpeakeven}^*(G)} y_e^{\text{cvaleven}^*(G)} u_e^{\text{nrcpeakeven}^*(G)} \times x_o^{\text{eareccpeakodd}^*(G)} y_o^{\text{cvalodd}^*(G)} u_o^{\text{nrcpeakodd}^*(G)} \lambda^{\text{cyc}(G)}. \quad (6.40) $$

We can then state:

**Theorem 6.12** (Generalized Stieltjes–Rogers polynomials for Theorem 5.1). With $\alpha$ given by (5.4), we have

$$ \hat{Q}_{2n,2k}(x_e, y_e, u_e, x_o, y_o, u_o, \lambda) = y_e^k y_o^k S_{n,k}(\alpha) \quad (6.41a) $$

$$ \hat{Q}_{2n+1,2k+1}(x_e, y_e, u_e, x_o, y_o, u_o, \lambda) = y_e^k y_o^{k+1} S'_{n,k}(\alpha) \quad (6.41b) $$
As preparation for this proof, we need a generalization of Lemma 4.2 from cycle-alternating permutations to alternating Laguerre digraphs:

**Lemma 6.13.** If $G$ is an alternating Laguerre digraph on the vertex set $[N]$, then

$$ \text{valleys: } \text{ulev}(i, G) \equiv i - 1 \pmod{2} \qquad (6.42a) $$

$$ \text{peaks: } \text{llev}(i, G) \equiv i \pmod{2} \qquad (6.42b) $$

for all $i \in [N]$. Here ulev and llev were defined in (6.26) and (6.28), respectively.

We introduce some new notation before providing the proof. Given a Laguerre digraph $G$ on the vertex set $[n]$ and a set $S \subseteq [n]$, let $G|_S$ denote the induced subgraph on the vertex set $S$ (which is, of course, also a Laguerre digraph). Also, let $h^S$ denote the number of paths in the graph $G|_S$.

**PROOF OF LEMMA 6.13.** To begin with, let $G$ be any Laguerre digraph, not necessarily alternating. Let $j$ be a valley in $G$. Then, in the graph $G|_{[j]}$, $j$ is an isolated vertex, i.e., $s(j) = p(j) = \infty$. From the definition (6.26) we have

$$ \begin{aligned} \text{ulev}(j, G|_{[j]}) &= \#\{i < j: s(i) = \infty\} \\ &= h^{[j]} - 1. \end{aligned} \qquad (6.43) $$

where the first equality holds because $j$ is the largest-numbered vertex in $G|_{[j]}$, so that $s(i) > j$ implies $s(i) = \infty$; and the second equality follows by noticing that the vertices $i$ with $s(i) = \infty$ correspond to the final vertices of the paths in $G|_{[j]}$ different from $j$.

Similarly, when $k$ is a peak in $G$, it follows from (6.28) that

$$ \begin{aligned} \text{llev}(k, G|_{[k]}) &= \#\{m < k: p(m) = \infty\} \\ &= h^{[k]}, \end{aligned} \qquad (6.44) $$

where the vertices $m$ with $p(m) = \infty$ correspond to the initial vertices of the paths in $G|_{[k]}$.

Next, observe that

$$ h^{[i]} = h^{[i-1]} + 1 \quad \text{when } i \text{ is a valley} \qquad (6.45a) $$

$$ h^{[i]} = h^{[i-1]} - 1 \quad \text{when } i \text{ is a peak} \qquad (6.45b) $$

The first formula is true because a valley $i$ is an isolated vertex in $G|_{[i]}$, and removing it decreases the number of paths by 1. On the other hand, if $i$ is a peak, it has both a predecessor and a successor in $G|_{[i]}$; so if $i$ is a cycle peak, removing it changes a cycle to a path, whereas if $i$ is a path peak, removing it splits the path into two paths; either way the number of paths is increased by 1.

Now let $G$ be an alternating Laguerre digraph on the vertex set $[N]$, with $k$ paths. Consider the lattice path $\omega$ starting at (0, 0) and ending at $(N, k)$ with steps $s_i = (1, 1)$ when $i$ is a valley and $s_i = (1, -1)$ when $i$ is a peak. By definition, the heights $h_i$ in the path $\omega$ satisfy the same recurrence (6.45) satisfied by the $h^{[i]}$; and of course
$h_0 = h^{[0]} = 0$ (since $[0] = \emptyset$). It follows that $h_i = h^{[i]} \ge 0$, and hence that $\omega$ is a partial Dyck path. This also implies that

$$h^{[i]} \equiv i \pmod{2}. \qquad (6.46)$$

The proof of (6.42) is completed by combining (6.43), (6.44) and (6.46) and noticing that $\mathrm{ulev}(i, G|_{[i]}) = \mathrm{ulev}(i, G)$ and $\mathrm{llev}(i, G|_{[i]}) = \mathrm{llev}(i, G)$. $\square$

**PROOF OF THEOREM 6.12.** We obtain the polynomials $\hat{Q}_{n,k}(x_e, y_e, u_e, x_o, y_o, u_o, \lambda)$ defined in (6.40) by using Lemmas 6.11 and 6.13 and eq. (6.29), and specializing the polynomials $\tilde{Q}_{n,k}(\mathbf{a}, \mathbf{b}, \lambda)$ defined in (6.30) to

$$\mathbf{a}_{\ell} = \begin{cases} y_o & \text{if } \ell \text{ is even} \\ y_e & \text{if } \ell \text{ is odd} \end{cases} \qquad (6.47a)$$

$$\mathbf{b}_{\ell, \ell'} = \begin{cases} x_e & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is even} \\ u_e & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is even} \\ x_o & \text{if } \ell' = 0 \text{ and } \ell + \ell' \text{ is odd} \\ u_o & \text{if } \ell' \ge 1 \text{ and } \ell + \ell' \text{ is odd} \end{cases} \qquad (6.47b)$$

(This is just (5.11) with all the $p, q$ variables set to 1.) Inserting these into Corollary 6.7 completes the proof of Theorem 6.12. $\square$

Next we show the $p, q$-generalization of all this. We extend the definition (5.5), specialized to $y_e = v_e$, $y_o = v_o$, $p_{+1} = q_{+1}$ and $p_{+2} = q_{+2}$, from permutations to Laguerre digraphs:

$$\hat{Q}_{n,k}(x_e, y_e, u_e, x_o, y_o, u_o, p_{-1}, p_{-2}, p_{+1}, p_{+2}, q_{-1}, q_{-2}, \lambda) = \sum_{G \in \mathcal{L}\mathcal{D}_{n,k}^{\text{alt}\infty}} x_e^{\text{eareccpeakeven}^*(G)} y_e^{\text{cvaleven}^*(G)} u_e^{\text{nrcpeakeven}^*(G)} \times \\ x_o^{\text{eareccpeakodd}^*(G)} y_o^{\text{cvalodd}^*(G)} u_o^{\text{nrcpeakodd}^*(G)} \times \\ p_{-1}^{\text{lcrosscpeakeven}^*(G)} q_{-1}^{\text{lnestcpeakeven}^*(G)} p_{+2}^{\text{ulevcvaleven}^*(G)} \times \\ p_{-2}^{\text{lcrosscpeakodd}^*(G)} q_{-2}^{\text{lnestcpeakodd}^*(G)} p_{+1}^{\text{ulevcvalodd}^*(G)}, \qquad (6.48)$$

where

$$\mathrm{lcrosscpeakeven}^*(G) = \sum_{k \in \mathrm{Peak}(G) \cap \mathrm{Even}} \mathrm{lcross}(k, G) \qquad (6.49)$$

and likewise for the others. We can then state:

**Theorem 6.14** (Generalized Stieltjes–Rogers polynomials for Theorem 5.2).

With $\boldsymbol{\alpha}$ given by (5.7), we have

$$\hat{Q}_{2n,2k}(x_e, y_e, u_e, x_o, y_o, u_o, p_{-1}, q_{-1}, p_{+2}, p_{-2}, q_{-2}, p_{+1}, \lambda) = p_{+1}^{k(k-1)} p_{+2}^{k^2} y_e^k y_o^k S_{n,k}(\boldsymbol{\alpha}) \qquad (6.50a)$$

$$\hat{Q}_{2n+1,2k+1}(x_e, y_e, u_e, x_o, y_o, u_o, p_{-1}, q_{-1}, p_{+2}, p_{-2}, q_{-2}, p_{+1}, \lambda) = p_{+1}^{k(k+1)} p_{+2}^{k^2} y_e^k y_o^{k+1} S'_{n,k}(\boldsymbol{\alpha}) \qquad (6.50b)$$
PROOF. The proof of Theorem 6.14 is almost identical to that of Theorem 6.12, but uses the full specialization (5.11). □

# Acknowledgments

We wish to thank Einar Steingrímsson and Jiang Zeng for helpful discussions. We also thank the organizers of the Heilbronn Workshop on Positivity Problems Associated to Permutation Patterns (Lancaster, UK, June 2022) for making these discussions possible.

The first author is currently supported by the DIMERS project ANR-18-CE40-0033 funded by Agence Nationale de la Recherche (ANR, France).

# A Nonexistence of J-fractions with polynomial coefficients

In this appendix we show that it is not possible to obtain nice J-fractions for polynomials that take account of the record status of both cycle peaks and cycle valleys and also count the number of cycles. Nor is it possible to obtain nice J-fractions for analogous polynomials restricted to alternating cycles. We show these two facts in the two following subsections.

## A.1 J-fraction for the polynomials (5.2)

Consider the polynomials

$$P_n(x, y, \lambda) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} x^{\text{eareccpeak}(\sigma)} y^{\text{ereccval}(\sigma)} \lambda^{\text{cyc}(\sigma)} \quad (A.1)$$

that were introduced in (5.2). By the reversal map $i \mapsto 2n + 1 - i$, we have the symmetry $x \leftrightarrow y$: $P_n(x, y, \lambda) = P_n(y, x, \lambda)$. The first few polynomials $P_n(x, y, \lambda)$ are

$$P_0(x, y, \lambda) = 1 \qquad (A.2a)$$

$$P_1(x, y, \lambda) = \lambda xy \qquad (A.2b)$$

$$P_2(x, y, \lambda) = \lambda xy [\lambda (1 + 2xy) + x + y] \qquad (A.2c)$$

$$P_3(x, y, \lambda) = \lambda xy [\lambda^2 (3 + 7xy + 5x^2y^2) \\ + \lambda (2 + 5x + x^2 + 5y + 4xy + 6x^2y + y^2 + 6xy^2) \\ + (3x + 2x^2 + 3y + 4xy + x^2y + 2y^2 + xy^2)]. \quad (A.2d)$$

We now give the first few J-fraction coefficients for this polynomial sequence: they are

$$\gamma_0 = \lambda xy, \quad \beta_1 = \lambda xy [\lambda (1 + xy) + x + y] \qquad (A.3)$$

followed by

$$\gamma_1 = \frac{\lambda^2(1+xy)(3+2xy) + \lambda(2+5x+x^2+5y+4xy+4x^2y+y^2+4xy^2) + (x+y)(3+2x+2y+xy)}{\lambda(1+xy)+x+y} \qquad (A.4)$$

It can then be shown that
(a) $\gamma_1$ is not a polynomial in $x$ (when $y$ and $\lambda$ are given fixed real values) unless $\lambda \in \{-1, 0, +1\}$ or $y \in \{-1, +1\}$.

(b) $\gamma_1$ is not a polynomial in $y$ unless $\lambda \in \{-1, 0, +1\}$ or $x \in \{-1, +1\}$.

(c) $\gamma_1$ is not a polynomial in $\lambda$ unless $x \in \{-1, +1\}$ or $y \in \{-1, +1\}$ or $x = -y$.

We state the polynomials $\gamma_1$ obtained from the foregoing specializations:

<table><thead><tr><th>Specialization</th><th>γ<sub>1</sub></th></tr></thead><tbody><tr><td>λ = -1</td><td>-1 + x + y - 2xy</td></tr><tr><td>λ = 0</td><td>3 + 2x + 2y + xy</td></tr><tr><td>λ = +1</td><td>5 + 3x + 3y + 2xy</td></tr><tr><td>x = -1</td><td>λ(3 - 2y) + 1 + y</td></tr><tr><td>x = +1</td><td>λ(3 + 2y) + 5 + 3y</td></tr><tr><td>y = -1</td><td>λ(3 - 2x) + 1 + x</td></tr><tr><td>y = +1</td><td>λ(3 + 2x) + 5 + 3x</td></tr><tr><td>x = -y</td><td>λ(3 - 2y<sup>2</sup>) + 2</td></tr></tbody></table>

These give rise to continued fractions as follows:

λ = +1. By [31, Theorem 2.18] specialized to $\lambda = u_1 = v_1 = 1$, $x_1 = x$, $y_1 = y$, we obtain an S-fraction with $\alpha_n = (x + n - 1)(y + n - 1)$, and hence by contraction (2.16) a J-fraction with $\gamma_0 = xy$, $\gamma_n = (x + 2n - 1)(y + 2n - 1) + (x + 2n)(y + 2n)$ for $n \ge 1$, $\beta_n = (x + 2n - 2)(x + 2n - 1)(y + 2n - 2)(y + 2n - 1)$.

y = +1. By [31, Theorem 2.21] specialized to $y_1 = u_1 = v_1 = 1$, $x_1 = x$, we obtain an S-fraction with $\alpha_n = (\lambda + n - 1)(x + n - 1)$. By contraction this yields a J-fraction with $\gamma_0 = \lambda x$, $\gamma_n = (\lambda + 2n - 1)(x + 2n - 1) + (\lambda + 2n)(x + 2n)$ for $n \ge 1$, $\beta_n = (\lambda + 2n - 2)(\lambda + 2n - 1)(x + 2n - 2)(x + 2n - 1)$.

x = +1. This follows from the case $y = +1$ by using the symmetry $x \leftrightarrow y$.

λ = 0. For all $n \ge 1$ and all $\sigma \in \mathfrak{S}_n$, each permutation contains at least one cycle. Therefore, setting $\lambda = 0$ suppresses all permutations for $n \ge 1$, and we have $P_n(x, y, 0) = \delta_{n0}$ (Kronecker delta). The value of $\gamma_1$ stated in the table above is completely irrelevant, because $\beta_1 = 0$.

λ = -1. We have found empirically an S-fraction with $\alpha_{2k-1} = -xy$, $\alpha_{2k} = -(1-x)(1-y)$ for $k \ge 1$, and have verified it through $\alpha_6$. More generally, we have found empirically an S-fraction involving the family of polynomials (5.1), which we recall are

$$ \hat{Q}_n(x_e, y_e, u_e, v_e, x_o, y_o, u_o, v_o, \lambda) = \sum_{\sigma \in \mathfrak{S}_{2n}^{\text{ca}}} x_e^{\text{eareccpkeeven}(\sigma)} y_e^{\text{ereccvaleven}(\sigma)} u_e^{\text{nrcpkeeven}(\sigma)} v_e^{\text{nrcvaleven}(\sigma)} \times x_o^{\text{eareccpeakodd}(\sigma)} y_o^{\text{ereccvalodd}(\sigma)} u_o^{\text{nrcpeakodd}(\sigma)} v_o^{\text{nrcvalodd}(\sigma)} \lambda^{\text{cyc}(\sigma)}. \quad (A.5) $$

Namely, after specializing $\lambda = -1$ we get an S-fraction with coefficients:

$$ \alpha_{2k-1} = -x_e y_o, \quad \alpha_{2k} = -(x_o - u_o)(y_e - v_e) \quad \text{for } k \ge 1. \quad (A.6) $$
(Note that $u_e$ and $v_o$ do not appear in this formula.) We have also verified this through $\alpha_6$. **Note added:** We have now proven these S-fractions; they will be published elsewhere [4].

$x = -1$, $y = -1$. These are polynomials through $\gamma_1$ and $\beta_2$. However $\gamma_2$ fails to be a polynomial.

$x = -y$. These are polynomials through $\beta_1$ and $\gamma_1$. However, $\beta_2$ fails to be a polynomial.

## A.2 J-fraction for the polynomials (5.2) restricted to alternating cycles

We now consider the polynomials

$$P_n^{\mathcal{A}\mathfrak{e}}(x, y) = \sum_{\sigma \in \mathcal{A}\mathfrak{e}_{2n}} x^{\text{eareccpeak}(\sigma)} y^{\text{ereccval}(\sigma)}, \quad (A.7)$$

which are simply the coefficient of $\lambda^1$ in the just-studied polynomials (A.1). We again have the symmetry $x \leftrightarrow y$: $P_n^{\mathcal{A}\mathfrak{e}}(x, y) = P_n^{\mathcal{A}\mathfrak{e}}(y, x)$.

We now give the first few J-fraction coefficients for the polynomial sequence $(P_{n+1}^{\mathcal{A}\mathfrak{e}}(x, y)/(xy))_{n \ge 0}$: they are

$$\gamma_0 = x + y, \quad \beta_1 = (x + y)(3 + x + y + xy) \quad (A.8)$$

followed by

$$\gamma_1 = \frac{30(x + y) + 18(x^2 + y^2) + 4(x^3 + y^3) + xy(34 + 29(x + y) + 5(x^2 + y^2)) + x^2y^2(8 + x + y)}{(x + y)(3 + x + y + xy)}. \quad (A.9)$$

It can then be shown that

(a) $\gamma_1$ is not a polynomial in $x$ (when $y$ is a given fixed complex value) unless $y \in \{-1, +1\}$.

(b) $\gamma_1$ is not a polynomial in $y$ unless $x \in \{-1, +1\}$.

The specializations $x, y \in \{-1, +1\}$ give rise to polynomials as follows:

$x = +1$ or $y = +1$. For the case $y = +1$, we specialize Corollary 5.3 to $y_e = y_o = u_e = u_o = v_e = v_o = 1$, $x_e = x_o = x$, to obtain an S-fraction with $\alpha_n = n(x + n)$. By contraction this yields a J-fraction with $\gamma_0 = x+1$, $\gamma_n = 2n(x+2n)+(2n+1)(x+2n+1)$ for $n \ge 1$, $\beta_n = (2n-1)(2n)(x+2n-1)(x+2n)$.

The case $x = +1$ follows by using the symmetry $x \leftrightarrow y$.

$x = -1$ or $y = -1$. These are polynomials through $\beta_2$ and $\gamma_1$. However, $\gamma_2$ fails to be a polynomial.

## References

[1] P. Biane, Permutations suivant le type d'excédance et le nombre d'inversions et interprétation combinatoire d'une fraction continue de Heine, European J. Combin. 14, 277-284 (1993).
[2] B. Deb, A. Dyachenko, M. Pétréolle and A.D. Sokal, Lattice paths and branched continued fractions, III: Generalizations of the Laguerre, rook and Lah polynomials, preprint (December 2023), arXiv:2312.11081 [math.CO].

[3] B. Deb and A.D. Sokal, Classical continued fractions for some multivariate polynomials generalizing the Genocchi and median Genocchi numbers, preprint (December 2022), arXiv:2212.07232 [math.CO].

[4] B. Deb and A.D. Sokal, A remark on continued fractions for permutations and D-permutations with a weight $-1$ per cycle, Electronic J. Combin. **31**(2), #P2.14 (2024).

[5] E. Deutsch and S. Elizalde, Cycle-up-down permutations, Australas. J. Combin. **50**, 187-199 (2011).

[6] E. Deutsch, L. Ferrari and S. Rinaldi, Production matrices, Adv. Appl. Math. **34**, 101-122 (2005).

[7] E. Deutsch, L. Ferrari and S. Rinaldi, Production matrices and Riordan arrays, Ann. Comb. **13**, 65-85 (2009).

[8] D. Dumont, Interprétations combinatoires des nombres de Genocchi, Duke Math. J. **41**, 305-318 (1974).

[9] D. Dumont, A combinatorial interpretation for the Schett recurrence on the Jacobian elliptic functions, Math. Comp. **33**, 1293-1297 (1979).

[10] D. Dumont, Une approche combinatoire des fonctions elliptiques de Jacobi, Adv. Math. **41**, 1-39 (1981).

[11] D. Dumont, *Pics de cycle et dérivées partielles*, Séminaire Lotharingien de Combinatoire **13**, article B13a (1986).

[12] D. Dumont and A. Randrianarivony, Dérangements et nombres de Genocchi, Discrete Math. **132**, 37-49 (1994).

[13] L. Euler, De seriebus divergentibus, Novi Commentarii Academiae Scientiarum Petropolitanae **5**, 205-237 (1760); reprinted in *Opera Omnia*, ser. 1, vol. 14, pp. 585-617. [Latin original and English and German translations available at http://eulerarchive.maa.org/pages/E247.html]

[14] L. Euler, De transformatione seriei divergentis $1 - mx + m(m+n)x^2 - m(m+n)(m+2n)x^3 + \text{etc.}$ in fractionem continuam, Nova Acta Academiae Scientiarum Imperialis Petropolitanae **2**, 36-45 (1788); reprinted in *Opera Omnia*, ser. 1, vol. 16, pp. 34-46. [Latin original and English and German translations available at http://eulerarchive.maa.org/pages/E616.html]

[15] P. Flajolet, Combinatorial aspects of continued fractions, Discrete Math. **32**, 125-161 (1980).

[16] P. Flajolet and J. Françon, Elliptic functions, continued fractions and doubled permutations, European J. Combin. **10**, 235-241 (1989).
[17] D. Foata and V. Strehl, Combinatorics of Laguerre polynomials, in *Enumeration and Design*, edited by D.M. Jackson and S.A. Vanstone (Academic Press, Toronto, 1984), pp. 123–140.

[18] D. Foata and D. Zeilberger, Denert's permutation statistic is indeed Euler-Mahonian, *Stud. Appl. Math.* **83**, 31–59 (1990).

[19] M. Josuat-Vergès, Enumeration of snakes and cycle-alternating permutations, *Australasian J. Combin.* **60**(3), 279–305 (2014).

[20] A.L. Lazar, The homogenized Linial arrangement and its consequences in enumerative combinatorics, Ph.D. thesis, University of Miami (August 2020), https://scholarship.miami.edu/discovery/delivery/01UOML_INST: ResearchRepository/12367619000002976?1#13367618990002976

[21] A. Lazar and M.L. Wachs, The homogenized Linial arrangement and Genocchi numbers, *Combin. Theory* **2**, issue 1, paper no. 2 (2022), 34 pp.

[22] S.C. Milne, Infinite families of exact sums of squares formulas, *Jacobi elliptic functions, continued fractions, and Schur functions*, Ramanujan J. **6**, 7–149 (2002).

[23] The On-Line Encyclopedia of Integer Sequences, published electronically at http://oeis.org

[24] M. Pétréolle, A.D. Sokal and B.-X. Zhu, Lattice paths and branched continued fractions: An infinite sequence of generalizations of the Stieltjes–Rogers and Thron–Rogers polynomials, with coefficientwise Hankel-total positivity, *Mem. Amer. Math. Soc.*, **291**, no. 1450 (2023).

[25] A. Randrianarivony and J. Zeng, Sur une extension des nombres d'Euler et les records des permutations alternantes, *J. Combin. Theory A* **68**, 86–99 (1994).

[26] L.J. Rogers, On the representation of certain asymptotic series as convergent continued fractions, *Proc. London Math. Soc. (series 2)* **4**, 72–89 (1907).

[27] A. Schett, Properties of the Taylor series expansion coefficients of the Jacobian elliptic functions, *Math. Comp.* **30**, 143–147 (1976); corrigendum **31**, 330 (1977).

[28] A. Schett, Recurrence formula of the Taylor series expansion coefficients of the Jacobian elliptic functions, *Math. Comp.* **31**, 1003–1005 (1977).

[29] A.D. Sokal, Multiple Laguerre polynomials: Combinatorial model and Stieltjes moment representation, *Proc. Amer. Math. Soc.* **150**, 1997–2005 (2022).

[30] A.D. Sokal, A simple algorithm for expanding a power series as a continued fraction, arXiv:2206.15434 [math.CO], *Expositiones Mathematicae* **41**, no. 2, 245–287 (2023).
[31] A.D. Sokal and J. Zeng, Some multivariate master polynomials for permutations, set partitions, and perfect matchings, and their continued fractions, Adv. Appl. Math. **138**, 102341 (2022).

[32] R.P. Stanley, A survey of alternating permutations, in: *Combinatorics and Graphs*, edited by R.A. Brualdi, S. Hedayat, H. Kharaghani, G.B. Khosrovshahi and S. Shahriari, Contemporary Mathematics #531 (American Mathematical Society, Providence, RI, 2010), pp. 165–196.

[33] R.P. Stanley, *Enumerative Combinatorics*, vol. 1, 2nd ed. (Cambridge University Press, Cambridge, 2012).

[34] T.J. Stieltjes, Sur la réduction en fraction continue d'une série procédant selon les puissances descendantes d'une variable, Ann. Fac. Sci. Toulouse **3**, H1–H17 (1889).

[35] G. Viennot, Interprétations combinatoires des nombres d'Euler et de Genocchi, Séminaire de Théorie des Nombres (Bordeaux), Année 1980-81, exposé no. 11 (1981).

[36] G. Viennot, Une théorie combinatoire des polynômes orthogonaux généraux, Notes de conférences données à l'Université du Québec à Montréal, septembre-octobre 1983. Available on-line at http://www.xavierviennot.org/xavier/polynomes_orthogonaux.html

[37] H.S. Wall, *Analytic Theory of Continued Fractions* (Van Nostrand, New York, 1948). Reprinted by the American Mathematical Society, Providence RI, 2000.

[38] J. Zeng, Énumérations de permutations et J-fractions continues, European J. Combin. **14**, 373–382 (1993).