Right-jumps and pattern avoiding permutations

We study the iteration of the process"a particle jumps to the right"in permutations. We prove that the set of permutations obtained in this model after a given number of iterations from the identity is a class of pattern avoiding permutations. We characterize the elements of the basis of this class and we enumerate these"forbidden minimal patterns"by giving their bivariate exponential generating function: we achieve this via a catalytic variable, the number of left-to-right maxima. We show that this generating function is a D-finite function satisfying a nice differential equation of order~2. We give some congruence properties for the coefficients of this generating function, and we show that their asymptotics involves a rather unusual algebraic exponent (the golden ratio $(1+\sqrt 5)/2$) and some unusual closed-form constants. We end by proving a limit law: a forbidden pattern of length $n$ has typically $(\ln n) /\sqrt{5}$ left-to-right maxima, with Gaussian fluctuations.


Introduction
In computer science, many algorithms related to sorting a permutation have been analysed and shown to have behaviours linked to nice combinatorial properties (see e.g. Knuth (1998)). Their complexity can be analysed in terms of memory needed, or number of key operations (like comparisons or pointer swaps). An important family of algorithms, like the so-called insertion algorithms, or in situ permutations, are quite efficient in terms of the number of pointer swaps (but are not the fastest ones in terms of comparisons). Due to this higher cost, they have been much less studied than the faster stack sorting algorithms. Like for the stack algorithms, instead of seeing them as an input/output pair, we can see them like a process: input and set of intermediate steps. This opens a full realm of questions on such processes, and they often lead to nice links with other parts of mathematics (like the link between trees, birth and death processes, random walks in probability theory, or permutations and Young tableaux in algebraic combinatorics). Our article will investigate a link between a sorting algorithm, patterns in permutations, and their asymptotics counterparts.
Another motivation to analyse such processes comes from the field of bioinformatics. Indeed, in genomics, a crucial part of study is to estimate the similarity of two genomes. This consists in finding the length of a shortest path of evolutionary mutations that transforms one genome into another. Usually, the main operations used in the rearrangement of a genome are of three different types: substitutions (one gene is replaced with another), insertions (a gene is added) and deletions (a gene is removed). For instance, we refer to Jones and Pevzner (2004); Meidanis and Setubal (1997) for an explanation of these operations, and the notions of transposons or jumping genes.
As the problem is too hard in full generality, many simpler mathematical models of the genome are used (see Ewens et al. (1982)): one of them is using permutations of {1, 2, . . . , n} where each gene is assigned a number. Following the idea of transposition mutations (see Jones and Pevzner (2004)), our motivation is to find some combinatorial properties in terms of pattern avoiding permutations whenever one element is deleted and inserted in a position to its right. This operation will be called a right-jump. 1 2 3 4 5 6 7 1 2 4 5 6 3 7 This operation is a variant of genome duplication, which consists of copying a part of the original genome inserted into itself, followed by the loss of one copy of each of the duplicated genes. In particular, it is comparable to the whole duplication-random loss model studied in Chaudhuri et al. (2006). Although there are many connections between these models, it is surprising that the behaviour of their combinatorial properties depends on different parameters: the right-jump model reveals some links with left-to-right maximum statistics (see Baril (2013); Bóna (2012)), while the whole duplication-random loss model reveals links with descent statistics (see Baril and Vernay (2010); Bouvel and Ferrari (2013); Bouvel and Pergola (2010); Bouvel and Rossin (2009) ;Chaudhuri et al. (2006); Mansour and Yan (2010)).
In the literature, such right-jumps in permutations are also found in the domain of sorting theory. Indeed, it corresponds (modulo a mirror symmetry) to the insertion-sorting algorithms on permutations (see Knuth (1998)). Since the seminal work of Knuth on this subject, many articles related to sorting with a stack exhibit links with pattern avoiding permutations. In contrast, for insertion sorting algorithms (also the subject of a vivid literature), only one study exhibits links with pattern avoiding permutations. Indeed, in his thesis, Magnússon (2013) proves that the set of permutations that can be sorted with one step of the insertion-sorting operator is the class of permutations avoiding the three patterns 321, 312 and 2143.
Plan of the article. In Section 2, we recall some basic facts on permutations patterns. In Section 3, we generalize the result of Magnússon by studying the iteration of right-jumps in terms of pattern avoiding permutations: we prove that the set of permutations obtained from the identity after a given number of right-jumps is the class of permutations avoiding some patterns, which we characterize. In Section 4, we enumerate these forbidden patterns by giving their bivariate exponential generating function (involving an additional parameter: the number of left-to-right maxima), and we give the corresponding asymptotics and limit law. We also give some modular congruences for our main enumeration sequence. In Section 5, we conclude with several possible extensions of this work.

Patterns in permutations
In this section, we give some classical definitions and properties on patterns in permutations. For any permutation σ ∈ S n (the set of permutations of length n), the graphical representation of σ = σ 1 σ 2 . . . σ n is the set of points in the plane at coordinates (i, σ i ) for i ∈ n (i) . For instance, the permutation 53621487 has the graphical representation illustrated in Figure 2. A left-to-right maximum of σ ∈ S n is a value σ i , 1 ≤ i ≤ n, such that σ j ≤ σ i for j ≤ i. A value σ i of σ, 1 ≤ i ≤ n which is not a left-to-right maximum will be called a non-left-to-right-maximum of σ. For instance, if σ = 53621487 then the left-to-right maxima are 5, 6, 8 and the non-left-to-right-maxima are 1, 2, 3, 4, 7. A permutation π of length k, is a pattern of a permutation σ ∈ S n if there is a subsequence of σ which is order-isomorphic to π, i.e., if there is a subsequence σ i1 . . . σ i k of σ with 1 ≤ i 1 < · · · < i k ≤ n and such that σ ij < σ i whenever π j < π . We write π ≺ σ to denote that π is a pattern of σ. A permutation σ that does not contain π as a pattern is said to avoid π. For example, σ = 2413 contains the patterns 231, 132, 213 and 312, but σ avoids the patterns 123 and 321. The set of all permutations avoiding the patterns π 1 , . . . , π m is denoted by Avoid(π 1 , . . . , π m ). We say that Avoid(π 1 , . . . , π m ) is a class of pattern avoiding permutations with basis {π 1 , . . . , π m }. For instance, we refer to the book of Kitaev (2011) and Bóna (2012) to deepen these notions. A set C of permutations is stable for the involvement relation ≺ if, for any σ ∈ C, for any π ≺ σ, then we also have π ∈ C. Now, we formulate a definition that is crucial for the present study. (i) In this article, we write n for {1, 2, . . . , n}.
Definition 1 (Permutation basis and basis permutations). If a set C of permutations is stable for the involvement relation ≺, then C is a class of pattern avoiding permutations: C = Avoid(B). The basis B of forbidden patterns is then given by B = {σ / ∈ C, ∀π ≺ σ with π = σ, π ∈ C} . In other words, the basis B is the set of minimal permutations σ that do not belong to C, where minimal is intended in the sense of the pattern-involvement relation ≺ on permutations, that is: if π ≺ σ and π = σ then π ∈ C. Notice that B might be infinite. We call basis permutations the permutations belonging to B.
Equipped with these definitions, our mission consists now in giving a description of the permutations belonging to the basis B p (the permutations which are the minimal forbidden patterns) for the set C p of permutations at distance at most p from the identity, i.e., permutations obtained from the identity after at most p right-jumps.
3 Iteration of right-jumps in permutations: a structural description of the forbidden patterns In this section we study the iteration of right-jumps in terms of pattern avoiding permutations. We establish that the set C p of permutations obtained from the identity after at most p right-jumps is a class of permutations avoiding some patterns that we characterize.
Lemma 1 (Characterization of the distance). A permutation obtained from the identity after p right-jumps contains at most p non-left-to-right-maxima.
Proof: The result holds for p = 1; indeed a right-jump transformation of the identity permutation creates the permutation 1 2 . . . (i − 1) (i + 1) . . . (j − 1) i j . . . n for 1 ≤ i < j, where i is the only one non-leftto-right-maximum. Now, let us assume that each permutation π obtained from the identity after (p − 1) right-jumps contains at most p − 1 non-left-to-right-maxima. Let σ be a permutation obtained from the identity after p right-jumps. Using the recurrence hypothesis, σ is obtained from a permutation π with at most p − 1 non-left-to-right-maxima by moving an element π i , 1 ≤ i < n, in a position to its right. We distinguish two cases: (1) π i is a non-left-to-right-maximum, and (2) π i is a left-to-right maximum. Case (1): Since π i is a non-left-to-right-maximum, there exists j < i such that π j is a left-to-right maximum satisfying π j > π i . Since we move π i to its right, π j remains on the left of π i in σ which implies that π i is a non-left-to-right-maximum in σ. Using the same argument, any non-left-to-right-maximum π k in π remains a non-left-to-right-maximum in σ. Moreover, let π k be a left-to-right maximum in π, i.e., π j < π k for all j < k. Since the right-jump transformation moves to the right of a non-left-to-rightmaximum, all values on the left of π k in σ are lower than π k , which proves that π k remains a left-to-right maximum in σ. Therefore, σ contains at most p − 1 non-left-to-right-maxima (as π does).
Case (2): π i is a left-to-right maximum, i.e., π j < π i for all j < i. Since π i is moved to its right, any left-to-right maximum located on the left of π i in π remains a left-to-right maximum in σ. On the other hand, any left-to-right maximum located on the right of π i in π is greater than π i and thus, it remains a left-to-right maximum in σ. Therefore, the number of left-to-right maxima in σ is at least the number of left-to-right maxima in π minus one (we do not consider π i ). This means that the number of non-left-toright-maxima in σ is at most p.
Considering the two previous cases allows to complete the proof, by induction.
We now derive our first enumeration result for the set D p of permutations at distance p from the identity, i.e., the set of permutations reachable from the identity with p right-jumps, but that one cannot reach with less than p right-jumps: C p = ∪ k∈ p D k , and this union is disjoint.
Theorem 1 (Permutations after p right-jumps). The set D p of permutations at distance p from the identity is the set of permutations with exactly p non-left-to-right-maxima. Accordingly, the number d n,p of permutations of length n in D p is counted by the Stirling numbers s(n, n − p): Proof: After considering Lemma 1, it suffices to prove that any permutation σ with at most p non-leftto-right-maxima can be obtained from the identity after p right-jumps. Let σ be a permutation with p ≥ 1 non-left-to-right-maxima. Let us assume that the leftmost non-left-to-right-maximum is σ i and let j < i be the position of the smallest left-to-right maximum σ j such that σ j > σ i . Then we set Thus, σ contains exactly p − 1 non-left-to-right-maxima and by construction, σ can be obtained from σ by a right-jump. This proves that permutations at distance p from the identity are exactly the permutations with n − p left-to-right-maxima, which are known to be counted by s(n, n − p), the signless Stirling number of the first kind (see Flajolet and Sedgewick (2009) for the closed-form formula due to Schlömilch, and sequence OEIS A094638 in Sloane and collaborators (2016) for many occurrences of the corresponding triangular array).
The following corollary says a little more on the lattice structure associated to our process "a particle jumps to the right".
Corollary 1 (Changing the starting point and sorting algorithms). For any permutation p, one denotes by t p its number of non-left-to-right-maxima. Let σ and π be two permutations, then t σ −1 ·π right-jumps are necessary to obtain π from σ. In particular, t σ −1 right-jumps are necessary and sufficient to sort by insertion the permutation σ into the identity.
Proof: Firstly, t σ right-jumps are necessary and sufficient to obtain σ from the identity. Therefore, t σ −1 ·π transformations are sufficient and necessary to obtain σ −1 · π from the identity. We set t = t σ −1 ·π and let Id = χ 0 , χ 1 , . . . , χ t−1 , χ t = σ −1 · π be a shortest path between the identity and σ −1 · π. Now, let us prove that if a permutation β is obtained from α by one right-jump, then for any permutation γ, γ · β is also obtained from γ · α by one right-jump. Indeed, if we have α = α 1 α 2 . . . α n then β can be written as which proves that γ · β is also obtained from γ · α by one right-jump. So if we compose by σ at each step of the above shortest path, then we obtain a shortest path of t σ −1 ·π right-jumps from σ to π, which completes the proof.
Since the set C p of permutations obtained after p right-jumps is stable for the relation ≺, C p is also a class Avoid(B p ) of pattern avoiding permutations where B p is the basis consisting of minimal permutations σ that are not in C p (see Definition 1). Theorem 2 gives the explicit description of these basis permutations.
Theorem 2 (Structural description of the basis permutations). A permutation σ ∈ S n belongs to the basis B p of forbidden patterns, if and only if the following conditions hold: (iv) For any three left-to-right maxima, σ i , σ j and σ k (with i < j < k) such that there is no left-to-right maximum between them, there exists a non-left-to-right-maximum σ t (with j < t < k) satisfying σ t > σ i .
Proof: N.B.: Figure 3 on next page illustrates the different claims and notations of this theorem. Let σ ∈ S n be a permutation belonging to the basis B p , i.e., σ / ∈ C p and π ≺ σ implies π ∈ C p . Throughout this proof, we refer to Figure 3 for an illustration of the three conditions (ii), (iii) and (iv).
-First, the deletion of a non-left-to-right-maximum in σ decreases the number of non-left-to-rightmaxima by one exactly. Therefore, the minimality of σ implies that σ necessarily contains exactly p + 1 non-left-to-right-maxima, which proves (i).
-For a contradiction, assume that (ii) is not satisfied, i.e., n − 1 is a left-to-right maximum. Since n is always a left-to-right maximum, n is on the right of n − 1 in σ. Thus, the permutation π obtained by deleting n from σ also contains p + 1 non-left-to-right-maxima (a non-left-to-right-maximum on the right of n in σ remains a non-left-to-right-maximum on the right of n − 1 in π). Therefore, π does not belong to C p ; this gives a contradiction with the minimality of σ.
-For a contradiction, assume that (iii) is not satisfied, i.e., σ 2 is a left-to-right maximum and thus, σ 1 is smaller than σ 2 . Thus, the permutation π obtained by deleting σ 1 from σ also contains p + 1 non-left-to-right-maxima. Indeed, a non-left-to-right-maximum σ i in σ such that σ i < σ 1 becomes a non-left-to-right-maximum σ i < σ 2 − 1 in π. Moreover, a non-left-to-right-maximum σ i in σ such that σ i > σ 1 (there is , 2 ≤ < i, with σ i < σ ) becomes a non-left-to-right-maximum σ i − 1 in π with σ i − 1 < σ − 1. Therefore, π does not belong to C p ; this gives a contradiction with the minimality of σ.
-For a contradiction, assume that (iv) is not satisfied; i.e., there are (i, j, k), 1 ≤ i < j < k ≤ n, such that σ i , σ j and σ k are three consecutive left-to-right maxima of σ (consecutive means that there is no other left-to-right maximum between σ i and σ j and between σ j and σ k ), and such that there is no non-left-to-right-maximum σ , j < < k, satisfying σ i < σ . Let π be the permutation obtained from σ by deleting σ j . It is clear that any non-left-to-right-maximum on the left of σ j in σ remains a non-left-toright-maximum in π. Let σ , > k, be a non-left-to-right-maximum on the right of σ k in σ. If σ < σ j then σ < σ j ≤ σ k − 1 and σ remains a non-left-to-right-maximum in π. If σ > σ j then there is σ t , t ≥ k, such that σ ≤ σ t ≥ σ k , and thus, there is σ t − 1 on the left of σ k − 1 in π with σ t − 1 > σ k − 1 which means that σ − 1 is a non-left-to-right-maximum in π. Let σ , j < < k, be a non-left-to-rightmaximum between σ j and σ k in σ. Assuming that (iv) is not satisfied, we deduce that σ < σ i , and σ remains a non-left-to-right-maximum in π. Finally, π also contains p + 1 non-left-to-right-maxima; this gives a contradiction with the minimality of σ.
Conversely, let σ be a permutation satisfying (i), (ii), (iii) and (iv) and π be a permutation obtained by deleting σ i , 1 ≤ i ≤ n, from σ. Let us prove that π belongs to C p , that is, π contains at most p non-left-to-right-maxima.
-If σ i is a non-left-to-right-maximum of σ, then π has p non-left-to-right-maxima and thus, π ∈ C p .
-Now, let us assume that σ i is a left-to-right maximum of σ. If σ i = n, then (ii) implies that n − 1 is a non-left-to-right-maximum of σ and a left-to-right maximum in π; this implies that π contains p non-leftto-right-maxima and thus, π ∈ C p . If σ i = σ 1 , then (iii) implies that σ 2 is a non-left-to-right-maximum of σ and σ 2 − 1 is a left-to-right maximum in π; this implies that π contains p non-left-to-right-maxima and thus, π ∈ C p . If there exists (j, k), 1 ≤ j < i < k ≤ n, such that σ j and σ k are left-to-right maxima (we choose j the greatest possible and k the lowest possible with this property). Then, (iv) implies that there is σ , i < < k, such that σ j < σ < σ i (we choose the lowest possible > i). Thus, σ is a non-left-to-right-maximum in σ and becomes a left-to-right maximum in π, which implies that π contains exactly p non-left-to-right-maxima, and thus π ∈ C p .
Finally, the permutation π necessarily belongs to C p , which completes the proof.
(iii) Figure 3: An illustration of Theorem 2 that characterizes the basis permutations of Bp. Condition (i) states such a basis permutation has p + 1 non-left-to-right maxima (drawn with a small black point, while left-to-right maxima are drawn with a big green point), condition (ii) states that n − 1 is not a left-to-right maximum, condition (iii) states that σ2 is not a left-to-right maximum, and condition (iv) states that there is a "higher" non-left-to-right maximum between 3 left-to-right maxima.
Corollary 2 (Length of the forbidden patterns). Permutations in B p have length ≤ 2(p + 1) and ≥ p + 2. As a consequence, B p is a finite set.

Enumerative results for basis permutations
In order to obtain a recursive formula for the number b n,p of permutations of length n in the basis B p , we present the following preliminary lemma.
Lemma 2 (A recursive description). Let σ ∈ S n be a basis permutation having p ≥ 1 non-left-to-rightmaxima and such that σ k+1 = n, k ≥ 0. Let α be the subsequence σ 1 σ 2 . . . σ k and π be the permutation in S k isomorphic to α. Then, π is a basis permutation with p − n + k + 1 non-left-to-right-maxima.
Proof: Any permutation σ can be uniquely written as σ = αnβ where α and β are two subsequences of n − 1 . Let k be the length of α and let π = π 1 π 2 . . . π k be the permutation of k that is isomorphic to the subsequence α. Let us prove that π is minimal.
Since σ is minimal, it satisfies the three conditions (ii), (iii) and (iv) of Theorem 2. Since all elements in β are non-left-to-right-maxima in σ, π contains exactly p − (n − 1 − k) non-left-to-right-maxima and thus, n − p − 1 left-to-right maxima.
-The condition (iii) of Theorem 2 on σ does not involve the part nβ. Therefore, π satisfies (iii).
-Let σ i , σ j and σ k+1 = n, 1 ≤ i < j ≤ k, be the last three left-to-right maxima of σ. After the deletion of nβ, the two left-to-right maxima of σ, σ i and σ j , are respectively transported in π into π i and π j = k. Condition (iv) on σ ensures that there is σ , between σ j and n such that σ > σ i . The greatest value σ satisfying this property is then transported in π into k − 1, which proves that k − 1 is on the right of k in π. Thus, π satisfies (ii).
Using Theorem 2, the permutation π is a basis permutation with p + − n + 1 non-left-to-rightmaxima.
Theorem 3 (An infinite recursion). The number b n,p of basis permutations of length n in B p (or equivalently having exactly p + 1 non-left-to-right-maxima) is given by the following recurrence relation (for p < n − 2): anchored with b n,p = 0 if p < (n − 2)/2 or p > n − 2, and b n,n−2 = (n − 1)! for n > 1.
Proof: Any permutation σ of length n ≥ 1 contains at least one left-to-right maximum and thus, at most n − 1 non-left-to-right-maxima which implies that b n,p = 0 for n ≤ p + 1. Using the proof of Corollary 2, we also have b n,p = 0 for n > 2(p + 1). Moreover, the basis permutations of length n with n − 1 non-leftto-right-maxima are the permutations of the form nα where α ∈ S n−1 . So, we have b n,n−2 = (n − 1)! for n > 1. Now, let us prove the recursive relation. Let σ ∈ S n be a basis permutation with p + 1 non-left-toright-maxima. We consider its unique decomposition σ = αnβ where α and β are some subsequences of n − 1 . Let + 2, ≥ 0, be the length of nβ and let π be the permutation in S n− −2 isomorphic to α. Using Lemma 2 with k = n − − 2, π is minimal with p − − 1 non-left-to-right-maxima. So, we can associate to σ = αnβ the pair (π, γ) where π ∈ S n− −2 is minimal with p− −1 non-left-to-right-maxima and γ ∈ S +1 is isomorphic to β.
Conversely, let π be a basis permutation of length n − − 2 with p − − 1 non-left-to-right-maxima and γ ∈ S +1 . We construct a basis permutation σ of length n with p + 1 non-left-to-right-maxima as follows. From γ ∈ S +1 , we construct a subsequence β of n − 1 of length + 1 such that β contains the value n − 1 and such that β is isomorphic to γ. Since n − 1 belongs to β, its position in β also is the position of the greatest value of γ. So, β is characterized by the choice of values among n − 2 . Now, we define the unique subsequence α of n − 2 \X isomorphic to π where X is the set of values used in β. This construction ensures that σ = αnβ is a basis permutation of length n with p + 1 non-leftto-right-maxima, and so σ ∈ B p . So, there are n−2 possibilities to choose the values of β and ( + 1)! possibilities to choose γ and b n− −2,p− −1 possibilities to choose a basis permutation π ∈ S n− −2 with p − − 1 non-left-to-right-maxima. Varying from 0 to p − 1, we obtain the recursive formula.
Theorem 3 allows us to find the bivariate exponential generating function for the number of basis permutations according to the number of non-left-to-right-maxima.
Theorem 4 (Closed-form for the bivariate generating function). Consider the bivariate exponential generating function B(x, y) = n≥0,p≥0 b n,p x n y p n! where the coefficient of x n y p n! is the number b n,p of basis permutations of length n in B p . Then, we have where V := 1 + 4/y .
Proof: Setting F p (x) := n≥0 b n,n−p x n n! and F (x, y) := p≥0 F p (x)y p , we have B(x, y) = F (xy, 1/y). (We work with the generating function F p (x) of the (b n,n−p )'s rather than the generating function of the (b n,p )'s because then the derivation of the proof is simpler to write).
Theorem 5 (Asymptotics). The exponential generating function for the number of basis permutations with respect to their length is given by It is a D-finite transcendental function satisfying the following differential equation Equivalently, its coefficients b n satisfy the recurrence and the asymptotics are given by where φ is the golden ratio φ = (1 + √ 5)/2, and Γ(z) := +∞ 0 t z−1 exp(−t)dt is the Euler gamma function.
Accordingly, a permutation of length n has a probability asymptotically 0 to be an element of the basis of forbidden patterns, however, this probability is not "very small" as it decays only polynomially: Prob(s ∈ S n belongs to ∪ p∈N B p ) = b n n! ≈ 0.499/n 0.381 (1 + o(1)) .
Proof: Setting y = 1 in the bivariate exponential generating function given in Theorem 4 gives B(x). If a function B(z) = b n z n is D-finite (it is satisfying a linear differential equation, with polynomial coefficients in z), then its coefficients b n are polynomially recursive (in short, P-recursive): they satisfy a linear recurrence, with polynomial coefficients in n. See e.g. Flajolet and Sedgewick (2009);Stanley (2012) for more on these two equivalent notions. Starting from the building blocks (1 − x) a , which are D-finite, and then using the closure properties of D-finite functions (by sum and product) gives the differential equation (3) (this is e.g. implemented in the Gfun Maple package, see Salvy and Zimmermann (1994)). The recurrence is obtained by extracting the coefficient of x n on both sides of the differential equation. The asymptotics follows from a singularity analysis (see Flajolet and Sedgewick (2009)) on each term of the shape (1 − x) a , indeed, for any a ∈ R which is not an integer, one has: Note that B(x, y) is D-finite in the variable x: but it is not D-finite in the variable y. This follows from a saddle point analysis on B(1, y) = n β n y n , indeed the asymptotics of β n involve arbitrarily large (ln n) d , while the asymptotics of a D-finite function can only have a finite sum of such powers of log, see Flajolet and Sedgewick (2009). This argument is thus similar to a proof that (1 − y) 1−y is not D-finite.
Remark [Irrational critical exponent]: It is very seldom that a combinatorial problem leads to some asympotics involving an irrational number as exponent. In fact, in combinatorics and in statistical physics, most of the asymptotics of integer sequences are of the shape b n ∼ Cn α A n , and the exponent α which appears there is a key quantity: its value is often the signature of some universal phenomena (in physics, it is called a critical exponent). For D-finite sequences, the theory implies that it is an algebraic number, however, this exponent is very often -3/2, or a dyadic number (for the reasons explained in Banderier and Drmota (2015)), or a rational number (due to a result on G-functions). Indeed, a theorem (resulting from the works of Katz, André, Chudnovsky & Chudnovsky, see Chambert-Loir (2002)) states that G-functions (D-finite functions with integer coefficients and non-zero radius of convergence) have a rational critical exponent. Now, instead of considering the exponential generating function B(x) = b n x n /n!, we may consider its inverse Borel transform, i.e., the ordinary generating function b n x n . It is also a D-finite function, because D-finite functions are closed by Hadamard product, and therefore the Borel transform (and the inverse Borel transform) of a D-finite function is D-finite (i.e., if the sequence b n is P-recursive, so are n!b n and b n /n!). We have thus a new D-finite function with integer coefficients and irrational critical exponent (involving the golden ratio φ), but this is not contradicting the G-function theorem, because, due to the multiplication by n!, we now have a 0 radius of convergence. In conclusion, we have the pleasure to have here one of the few examples in combinatorics of a problem leading to an irrational critical exponent. Other examples are given via the KPZ formula in physics, or via quantities related to quadtrees, see Flajolet and Sedgewick (2009).
Pushing further the asymptotics from Theorem 5, we get the following limit law: Theorem 6 (Limit Law). In the model where all permutations of length n are equidistributed, a random permutation of length n in ∪ p∈N B p is typically a member of B p , for p ∼ n − (ln n)/ √ 5, with Gaussian fluctuations. Equivalently, the average number of left-to-right-maxima in a random basis permutation is p ∼ (ln n)/ √ 5 with Gaussian fluctuations.
Proof: This follows from the closed-expression for B(x, y), or from a singularity analysis of the differential equation. Indeed, the average and standard deviation follow from the computation of ∂ y B(x, y) and ∂ 2 y B(x, y) at y = 1. The Gaussian limit law follows from the quasi-power theorem applied to a variable exponent perturbation or to our non-confluent differential equation (see Theorem IX.11 and Theorem IX.18 from Flajolet and Sedgewick (2009)).
As a random permutation of S n has ln n left-to-right maxima on average, the above theorem quantifies to what extent the right-jump process kills the left-to-right maxima when one starts from the identity permutation. For the combinatorial structure B p , it could be possible that its complementary set has a nicer structure. Those permutations not in the basis are for sure counted by u n = n! − b n ; this sequence satisfies u n+3 = (n + 1)(n 2 − n − 1)u n − (3n 2 + 3n − 1)u n+1 + 3(n + 1)u n+2 , which is still a nice recurrence but of order one more than the recurrence for b n , so it is a heuristic confirmation than b n is a more fundamental sequence than u n .
There is a vast literature in number theory analysing the modular congruences of famous sequences (Pascal triangle, Fibonacci, Catalan, Motzkin, Apéry numbers, see Deutsch and Sagan (2006); Xin and Xu (2011); Rowland and Zeilberger (2014); Kauers et al. (2011)). The properties of b n mod m are sometimes called "supercongruences" when m is the power of a prime number: many articles consider m = 2 r , or m = 3 r . We now give a result which holds for any m (not necessarily the power of a prime number).
Theorem 7 (Supercongruences for D-finite functions). Consider any P-recurrence of order r: If the polynomial P 0 (n) is ultimately invertible mod m (i.e., gcd(P 0 (n), m) = 1, for all n large enough), then the sequence (u n ) is ultimately periodic (ii) mod m, and there is an algorithm to get this period.
In particular, recurrences such that P 0 (n) = 1 are periodic mod m. Accordingly, our sequence b n mod m (defined by recurrence (4)) is periodic for any m.
Proof: Indeed, as the leading term P 0 is invertible, we can write: in which each term has just a finite set of possible values. What is more, for any polynomial P (n) with integer coefficients, P (n) mod m is of period p, for some p|m. (This follows from the fact that the sum and the product is preserving periodicity mod m, as we did not require in the definition of "period" that m is the smallest m such that the sequence is m periodic). Therefore, one can then construct a Markov chain (an automaton): the states are all the possible 2r + 1-tuples of values mod m for (P 0 (n), . . . , P r (n), u n−1 , . . . , u n−r ), and the recurrence dictates the transitions in this Markov chain. The pigeonhole principle implies that there is a loop in this finite graph, and our period is thus one of the divisors of the length of this loop. Besides, the smallest period p and the first integer n 1 satisfying u n = u n+p mod m for n ≥ n 1 are such that p + n 1 is smaller than the number of states in the automaton, i.e. smaller than m 2r+1 , or more precisely smaller than φ(m)m 2r where φ(m) is the Euler totient function (the number of invertible elements modulo m, as P 0 (n) is ultimately invertible).
The period can be quite large, for example b n mod 3617 has period 26158144. We say more on this phenomenon for P-recursive sequences in Banderier and Luca (2018). (ii) In the sequel, we will omit the word "ultimately": a periodic sequence of period p is thus a sequence for which u n+p = un for all large enough n. Some authors use the terminology "eventually periodic" instead.

Conclusion
In this article, we analysed the iteration of the process "a particle jumps to the right" in a permutation, and we gave the typical properties of the patterns which are not reached after p moves. We expect our approach (introducing a catalytic variable and getting a D-finite function) to work in many other cases. However, we already know a nice permutation class for which the basis is not D-finite. Indeed, as an extension of this work, an interesting question is to consider a model in which both right-jumps and left-jumps are allowed: this is a very natural process, also related to sorting algorithms and bioinformatics processes. In a forthcoming work, we show that for this new model, the basis of forbidden minimal patterns for permutations obtained by p iterations of the process is related to Young Tableaux with 2 equally long first rows (but it is no longer D-finite, unlike the pure right-jump iteration process that we considered in this article). Another natural question is: is it the case that using e.g. the correspondence between records and cycles in permutations, there is an elegant process corresponding to a "particle jumps to the right", with permutations at distance p from identity being counted in terms of cycles in the permutation? To get direct "bijective" proofs of our formulae is also an interesting question: as a credo, it cannot be the case that such nice formulae/recurrences are only reached by solving differential equations (like we did in this article). It may be the case that a generating tree approach leads to the simple recurrence (4) we get for b n (see e.g. Banderier et al. (2002) or Barcucci et al. (1999)). With respect to the asymptotics, it is noteworthy that the process analysed in the present article involves the golden ratio (this is very unusual in combinatorics to have this constant as critical exponent): is it the trace of some universality class? (Like it is sometimes the case for problems coming from statistical mechanics, see our remark after Theorem 5.) Last but not least, we already mentioned a vast literature of publications in number theory analysing the modular congruences of famous sequences (Pascal triangle, Fibonacci, Catalan, Motzkin, Apéry numbers, . . . , Deutsch and Sagan (2006); Xin and Xu (2011)). It seems to us that our approach to tackle them at the level of D-finite functions is new (see also Kauers et al. (2011); Rowland and Zeilberger (2014)), and it would be worth analysing these properties in full generality. In this article, we proved by a mixture of Ansatz and brute force proof that b n mod m (where m can be any integer) is a periodic function (of period bounded by a polynomial in m). In fact, we prove in Banderier and Luca (2018) that this period and the values of b n mod m for any given m can be made explicit.