Mireille Bousquet-M Élou

FAMILIES OF PRUDENT SELF-AVOIDING WALKS

Keywords: Enumeration, self-avoiding walks, D-finite series

A self-avoiding walk (SAW) on the square lattice is prudent if it never takes a step towards a vertex it has already visited. Prudent walks differ from most classes of SAW that have been counted so far in that they can wind around their starting point.

Their enumeration was first addressed by Préa in 1997. He defined 4 classes of prudent walks, of increasing generality, and wrote a system of recurrence relations for each of them. However, these relations involve more and more parameters as the generality of the class increases.

. Here, we solve exactly the third class, which turns out to be much more complex: its generating function is not algebraic, nor even D-finite.

The fourth class -general prudent walks -is the only isotropic one, and still defeats us. However, we design an isotropic family of prudent walks on the triangular lattice, which we count exactly. Again, the generating function is proved to be non-D-finite.

We also study the asymptotic properties of these classes of walks, with the (somewhat disappointing) conclusion that their endpoint moves away from the origin at a positive speed. This is confirmed visually by the random generation procedures we have designed. c(n) ∼ αµ n n γ and E(D n ) ∼ κn ν

Introduction

Families of self-avoiding walks

The study of self-avoiding walks is a famous "elementary" problem in combinatorics, which is also of interest in probability theory and in statistical physics [START_REF] Madras | The self-avoiding walk. Probability and its Applications[END_REF]. Recall that, given a lattice with some origin O, a self-avoiding walk (SAW) is a lattice path starting from O that does not visit the same vertex twice (Fig. 1).

Figure 1. A self-avoiding walk on the square lattice, and a (quasi-)random SAW of length 1,000,000, constructed by Kennedy using a pivot algorithm [START_REF] Kennedy | A faster implementation of the pivot algorithm for self-avoiding walks[END_REF].

It is strongly believed that, for two-dimensional lattices, the number c(n) of n-step SAW and the average end-to-end distance of these walks satisfy where γ = 11/32 and ν = 3/4. The growth constant µ is lattice-dependent. Several independent but so far non-rigorous methods predict that µ = 2 + √ 2 on the honeycomb lattice. Moreover, numerical studies suggest that µ may also be a bi-quadratic number for the square lattice [START_REF] Jensen | Self-avoiding polygons on the square lattice[END_REF]. On the probability side, it has been proved that, if the scaling limit of SAW exists and has some conformal invariance property, it must be described by the process SLE(8/3) (stochastic Loewner evolution) [START_REF] Lawler | On the scaling limit of planar self-avoiding walk[END_REF]. This would imply that the predicted values of γ and ν are correct.

The fact that all these conjectures only deal with asymptotic properties of SAW tells us how far the problem is from the reach of exact enumeration. The followers of this discipline thus focus on the study of sub-classes of SAW. A simple family consists of partially directed walks, that is, self-avoiding walks formed of North, East and West steps. It is easy to see that their generating function is rational [START_REF] Stanley | Enumerative combinatorics[END_REF]Example 4.1.2],

n c(n)t n = 1 + t 1 -2t -t 2 , (1)
which gives c(n) ∼ αµ n , with µ = 1 + √ 2 = 2.41... The above series can be refined by taking into account the coordinates (X n , Y n ) of the endpoint, and the analysis of the result gives:

E(X n ) = 0, E(X 2 n ) ≃ n and E(Y n ) ≃ n.
We use the notation a n ≃ b n as a shorthand for a n ∼ αb n for some positive constant α.

The prudent walks studied in this paper form a more general class of SAW which have a natural kinetic description: a walk is prudent if it never takes a step pointing towards a vertex it has already visited. In other words, the walk is so cautious that it only takes steps in directions where the road is perfectly clear. Various examples are shown on Fig. 2. In particular, partially directed walks are prudent. Note that it is equivalent to require that the new step avoids the past convex hull of the walk: hence prudent walks are the discrete counterpart of the walks evolving in discrete time but continuous space studied by Angel et al. [START_REF] Angel | Random walks that avoid their past convex hull[END_REF].

Figure 2. Four prudent walks: the first one is partially directed (or: 1-sided), the other ones are respectively 2-sided, 3-sided and 4-sided. These walks have already been studied in the past under different names: self-directed walks [START_REF] Turban | Self-directed walk: a Monte Carlo study in two dimensions[END_REF], outwardly directed SAW [START_REF] Santra | Directed self-avoiding walks in random media[END_REF], exterior SAW [START_REF] Préa | Exterior self-avoiding walks on the square lattice[END_REF], and finally prudent walks [START_REF] Duchi | On some classes of prudent walks[END_REF][START_REF] Dethridge | Prudent self-avoiding walks[END_REF]. We refrain from the temptation of inventing one more name and stick to the latter terminology. The first two papers above deal with Monte-Carlo simulations. Préa [START_REF] Préa | Exterior self-avoiding walks on the square lattice[END_REF] was, to our knowledge, the first to address enumerative questions. He wrote recurrence relations defining an array of numbers c(n; i, j, h) that count prudent walks according to their length (n) and to three additional catalytic parameters (i, j, h). By this, we mean that these parameters are essential to the existence of these recurrence relations, and that it is far from obvious how to derive from them a recursion for, say, some numbers c(n; i, j) that would only take into account two of the catalytic parameters (or for c(n)). Préa also defined four natural families of prudent walks of increasing generality, called k-sided, for k ranging from 1 to 4. In particular, 1-sided walks coincide with partially directed walks, and 4-sided walks coincide with general prudent walks. (Precise definitions will be given below.) He wrote recurrence relations for each of these classes: three catalytic parameters are needed for general (4-sided) prudent walks, but two suffice for 3-sided walks, while one is enough for 2-sided walks. No catalytic parameter is needed for 1-sided walks. This reflects the increasing generality of these four classes of walks.

Recall that the generating function of 1-sided walks (partially directed walks) is rational [START_REF] Andrews | The theory of partitions[END_REF]. Duchi [START_REF] Duchi | On some classes of prudent walks[END_REF] proved that 2-sided walks have an algebraic (quadratic) generating function. She also found an algebraic generating function for 3-sided walks, but there was a subtle flaw in her derivation, which was detected by Guttmann [16]. He and Dethridge performed a numerical study of prudent walks, in order to get an idea of their asymptotic enumeration, and of the properties of the associated generating functions [START_REF] Dethridge | Prudent self-avoiding walks[END_REF]. In particular, they conjectured that the length generating function of general prudent walks is not D-finite, that is, does not satisfy any linear differential equation with polynomial coefficients. This implies that it is not algebraic.

Contents

In Section 2 of this paper, we collect functional equations that define the generating functions of the four classes of prudent walks introduced by Préa [START_REF] Préa | Exterior self-avoiding walks on the square lattice[END_REF]. This is not really original, as these equations are basically equivalent to Préa's recurrence relations. Moreover, similar equations were written by Duchi [START_REF] Duchi | On some classes of prudent walks[END_REF]. Our presentation may be a bit more systematic.

In Sections 3 to 5 we address the solution of these equations. The case of 1-sided walks is immediate and leads the above rational generating function. We then recall how the kernel method solves linear equations with one catalytic variable. In particular, it provides the generating function of 2-sided walks (Section 3). The extension of this method to linear equations with two catalytic variables is not yet completely understood, although a number of papers have been devoted to instances of such equations recently [START_REF] Bousquet-Mélou | Walks confined in a quadrant are not always D-finite[END_REF][START_REF] Bousquet-Mélou | Walks in the quarter plane: Kreweras' algebraic model[END_REF][START_REF] Bousquet-Mélou | Walks with small steps in the quarter plane[END_REF][START_REF] Bousquet-Mélou | On partitions avoiding 3-crossings[END_REF][START_REF] Janse Van Rensburg | Partially directed paths in a wedge[END_REF][START_REF] Mishna | Two non-holonomic lattice walks in the quarter plane[END_REF][START_REF] Mishna | Classifying lattice walks restricted to the quarter plane[END_REF]. Underlying the bi-variate kernel method is a certain group, which depends on the equation. Roughly speaking, the instances that have been studied suggest that the solution is "nice" if the group is finite. This belief is confirmed by the example of 3-sided walks. The corresponding equation is associated with an infinite group, but we can still solve it, and prove that the generating function of these walks is not D-finite, having a rather complex singularity structure (Section 4). We also prove that the growth constants of 3-sided walks and 2-sided walks are the same. It is actually predicted from numerical experiments that the growth constant of general prudent walks is also the same [START_REF] Dethridge | Prudent self-avoiding walks[END_REF].

The final equation, which deals with general prudent walks and involves three catalytic variables, still defeats us. This is a bit annoying, as the other classes are by definition anisotropic. However, our understanding of the role of catalytic variables leads us to introduce a new isotropic class of prudent walks, on the triangular lattice, which are described by (only) two catalytic variables (Fig. 3, left). Again, the associated equation corresponds to an infinite group. We solve it, and prove that the generating function of triangular prudent walks is not D-finite, having a natural boundary (Section 5). We also refine our equations to take into account parameters related to the end-to-end distance of a prudent walk: for instance the coordinates of the endpoint, or the size of the smallest rectangle containing the walk. Extending our solutions to these refined equations is harmless, but the conclusion we draw from these results is somewhat disappointing: the prudent walks we can solve drift away from the origin at a positive speed. In other words, the end-to-end distance grows linearly with the length of the walk. We do not know what happens for general (4-sided) prudent walks.

Finally, in Section 6, we address the uniform random generation of n-step prudent walks. Their step-by-step recursive structure allows for a standard recursive approach, in the spirit of [START_REF] Nijenhuis | Combinatorial algorithms[END_REF]. This approach first requires a precomputation stage, followed by a generation stage, which is usually linear. We emphasize that the (costly) precomputation may require less information than the generation itself, and we use this to optimize the precomputation stage. Our final procedures involve the precomputation and storage of up to O(n 4 ) numbers (for general prudent walks), so that the typical length we can reach is a few hundred. This still provides interesting pictures (Figs. [START_REF] Beffara | Scaling limit of the prudent walk[END_REF][START_REF] Bousquet-Mélou | Walks with small steps in the quarter plane[END_REF][START_REF] Bousquet-Mélou | Linear recurrences with constant coefficients: the multivariate case[END_REF][START_REF] Bousquet-Mélou | Walks confined in a quadrant are not always D-finite[END_REF].

Families of prudent walks

Let us conclude this long introduction with some definitions and notations. The box of a square lattice walk is the smallest rectangle that contains it. It is not hard to see that the endpoint of a prudent walk is always on the border of the box. This means that every new step either walks on the border of the box, or moves one of its four edges.

Using this box, we can give a kinetic description of partially directed walks: a prudent walk is partially directed if its endpoint, as the walk grows, always lies on the top of the box. This is why partially directed walks are also called 1-sided. The generalisation of this terminology is natural: a prudent walk is 2-sided if its endpoint always lies either on the top, or on the right edge of the box. It is 3-sided if its endpoint is always on the top, right or left edge of the box1 . Of course, 4-sided walks coincide with general prudent walks (Fig. 2).

Consider now a walk on the triangular lattice. Define the (triangular) box of the walk as the smallest triangle pointing North that contains the walk. The walk is a triangular prudent walk if each new step either inflates the box, or walks along one edge of the box in a prudent way (that is, not pointing to an already visited vertex). An example is shown in Fig. 3. Note that this is not the natural counterpart of a square lattice prudent walk: this counterpart would just require the walk to avoid pointing to an already visited vertex. But then the natural "box" would be a hexagon: every new step would either inflate the hexagonal box, or walk along its border. As we will see below, the number of edge lengths of the box (3 for a hexagon, 1 for a triangle) is directly related to the number of catalytic parameters we have to introduce, and this is what makes triangular prudent walks relatively easy to handle.

Given a class of walks C, the generating function of walks of C, counted by their length, is

C(t) = w∈C t |w| ,
where |w| denotes the length of the walk w. The generalisation of this definition to the series C(t; u 1 , . . . , u k ) counting walks according to their length and to k additional parameters is immediate. We will often drop the length variable t, denoting this series C(u 1 , . . . , u k ). Recall that a one-variable series C(t) is algebraic if it satisfies a polynomial equation P (t, C(t)) = 0, and D-finite if it satisfies a linear ODE with polynomial coefficients, P k (t)C (k) (t) + • • • + P 1 (t)C ′ (t) + P 0 (t)C(t) = 0. Every algebraic series is D-finite. We refer to [START_REF] Stanley | Enumerative combinatorics[END_REF] for generalities about these classes of power series.

Functional equations

The construction of functional equations for all the families of prudent walks we study rely on the same principle, which we first describe on 1-sided (partially directed) walks.

Consider a 1-sided walk. If it ends with a horizontal step, we can extend it in two different ways: either we repeat the last step, or we change direction and add a North (N) step. Otherwise, the walk is either empty or ends with a North step, and we have three ways (N, E and W) to extend it. This shows that North steps, which move the top edge of the box, play a special role in these walks. Our functional equation is obtained by answering the following question: where is the last North step, and what has happened since then?

More specifically, let P (t) denote the length generating function of 1-sided prudent walks. The contribution to P (t) of walks that contain no North step (horizontal walks) is

1 + 2 n≥1 t n = 1 + t 1 -t .
The other walks are obtained by concatenating a 1-sided walk, a North step, and then a horizontal walk. Their contribution is thus

P (t) t 1 + t 1 -t .
Adding these two contributions gives the equation

P (t) = 1 + t 1 -t + t 1 + t 1 -t P (t),
from which we readily derive the rational expression [START_REF] Andrews | The theory of partitions[END_REF]. The principle of this recursive description extends to k-sided walks for each k. We say that a step of a k-sided walk is inflating if, at the time it was added to the walk, it shifted one of the k edges of the box that are relevant in the definition of k-sided walks. For instance, when k = 2, an inflating step moves the top or right edge of the box. We write our equations by answering the question: where is the last inflating step, and what has happened since then?

Since then, the walk has grown without creating a new inflating step. What does that mean? Assume k ≥ 2, that the last inflating step was North, and that, since then, the walk has taken m East steps. Then m cannot be arbitrarily large, otherwise one or several of these East steps would be inflating, having moved the right edge of the box. This observation explains why we have to take into account other "catalytic" parameters in our enumeration of prudent walks. For instance, for a 2-sided walk, we keep track of the distance between the endpoint and the NE corner of the box, using a new variable u (Fig. 5). For 3-sided walks ending on the top of the box, we keep track of the distances between the endpoint and the NE and NW corners of the box (variables u and v). For 3-sided walks ending on the right edge of the box, we keep track of the distance between the endpoint and the NE corner (variable u) and of the width of the box (variable w). For 4-sided walks ending on the top of the box, we keep track of the distances between the endpoint and the NE and NW corners (variables u and v), and of the height of the box (variable w). These parameters, and the names of the corresponding variables, are schematized in Fig. 5. They give rise to series with one, two or three catalytic variables. For instance, for 4-sided walks ending on the top of their box, we will use the series

T (t; u, v, w) ≡ T (u, v, w) = i,j,h T i,j,h u i v j w h ,
where T i,j,h ≡ T i,j,h (t) counts 4-sided walks ending on the top of their box, at a distance i (resp. j) from the NE (resp. NW) corner, such that the height of the box is h. Similar notation will be used for the other classes of walks. Finally, for triangular prudent walks ending on the right edge of their (triangular) box, we keep track of the distances between the endpoint and the SE and N corners of the box (variables u and v, see Fig. 3).

Two-sided prudent walks

Lemma 1. The generating function T (t; u) ≡ T (u) of 2-sided walks ending on the top of their box satisfies

1 - tu(1 -t 2 ) (1 -tu)(u -t) T (u) = 1 1 -tu + t u -2t u -t T (t).
The generating function of 2-sided walks, counted by their length and the distance of the endpoint to the NE corner of the box, is

P (t; u) = 2T (t; u) -T (t; 0).
Proof. We partition the set of 2-sided walks ending on the top of their box into 3 classes, depending on the existence and direction of the last inflating step (LIS). This step, if it exists, has moved the right or top edge of the box. 1. Neither the top nor the right edge has ever moved: the walk is a sequence of West steps. The generating function for this class is 1 1 -tu .

2. The LIS goes East. This implies that the endpoint of the walk was on the right edge of the box before that step. After that East step, the walk has made a sequence of N steps to reach the top of the box. Observe that, by symmetry, the series T (t; u) also counts walks ending on the right edge of the box by the length and the distance between the endpoint and the NE corner. These two observations give the generating function for this class as t i≥0 T i t i = tT (t).

3. The LIS goes North. After this step, there is either an (unbounded) sequence of West steps, or a bounded sequence of East steps. This gives the generating function for this class as

t 2 u 1 -tu T (u) + t i≥0 T i i k=0 t k u i-k = t 2 u 1 -tu T (u) + t u -t (uT (u) -tT (t)) .
Adding the 3 terms gives the functional equation satisfied by T (u). The expression of P (t; u) relies on an inclusion-exclusion argument: we first double the contribution of T (u) to take into account walks ending on the right edge of the box, and then subtract the series T (0) counting those that end at the NE corner.

Three-sided prudent walks

Lemma 2. The generating functions T (t; u, v) ≡ T (u, v) and R(t; u, w) ≡ R(u, w) that count respectively 3-sided walks ending on the top and on the right edge of their box are related by

1 - tuv(1 -t 2 ) (u -tv)(v -tu) T (u, v) = 1 + tuR(t, u) + tvR(t, v) - t 2 v u -tv T (tv, v) - t 2 u v -tu T (u, tu) (2) 1 - tuw(1 -t 2 ) (u -t)(1 -tu) R(u, w) = 1 1 -tu + tT (tw, w) - t 2 w u -t R(t, w). (3)
The generating function of 3-sided walks, counted by the length and by the width of the box, is

P (t; u) = T (t; u, u) + 2R(t; 1, u) -2T (t; u, 0) - t 1 -t .
Proof. We partition the set of 3-sided walks ending on the top of their box into 4 subsets, depending on the existence and direction of the LIS, which has moved the right, left or top edge of the box. 1. There is no inflating step at all: the walk is empty and contributes 1 to the generating function. 2. The LIS goes East. This case is analogous to Case (2) of 2-sided walks, with generating function tv

i,j R i,j t i v j = tvR(t, v).
3. Symmetrically, the case where the LIS goes West is counted by tuR(t, u).

4. If the LIS is a North step, it is followed by a bounded number of West steps, or by a bounded number of East steps. This case is counted by:

t i,j≥0 T i,j i k=0 t k u i-k v j+k + j k=0 t k u i+k v j-k -u i v j = t u -tv (uT (u, v) -tvT (tv, v)) + t v -tu (vT (u, v) -tuT (u, tu)) -tT (u, v).
Adding the 4 terms gives the first equation of the lemma. For 3-sided walks ending on the right edge of their box, the last inflating step cannot go West.

Three cases remain:

1. There is no inflating step at all: the walk consists of South steps. The generating function for this class is 1 1 -tu .

2. The LIS goes East. This case is analogous to Case (3) of 2-sided walks: the LIS is followed by an unbounded number of South steps, or by a bounded number of North steps. The generating function is

t 2 uw 1 -tu R(u, w) + tw u -t (uR(u, w) -tR(t, w)) .
3. The LIS goes North. This case is analogous to Case (2) of 2-sided walks. The generating function is found to be tT (tw, w).

Adding the 3 terms gives the functional equation for R(u, w).

The expression of P (t; u) again relies on an inclusion-exclusion argument, based on the enumeration of walks ending on a prescribed set of edges of their box.

2.3.

General prudent walks on the square lattice Lemma 3. The generating function T (t; u, v, w) ≡ T (u, v, w) of prudent walks ending on the top of their box satisfies

1 - tuvw(1 -t 2 ) (u -tv)(v -tu) T (u, v, w) = 1 + G(w, u) + G(w, v) - tv u -tv G(v, w) - tu v -tu G(u, w) with G(u, v) ≡ G(t; u, v) = tvT (t; u, tu, v).
The generating function of prudent walks, counted by the length and the half-perimeter of the box, is

P (t; u) = 1 + 4T (t; u, u, u) -4T (t; 0, u, u).
We have learnt from [START_REF] Dethridge | Prudent self-avoiding walks[END_REF] that Andrew Rechnitzer has independently obtained the functional equation satisfied by T (u, v, w).

Proof. Again, we partition the set of prudent walk ending on the top of their box into 4 subsets, depending on the existence and direction of the last inflating step. Note that the LIS cannot be a South step.

1. There is no inflating step: the walk is empty, and contributes 1 to the generating function.

2. The LIS goes East. This case is analogous to Case (2) of 2-sided walks. Using the obvious symmetry between prudent walks ending on the top and on the right edge of their box, we find that the generating function for this class is

tv i,j,h T i,j,h t j w i+j v h = tvT (w, tw, v).
3. Symmetrically, the generating function of prudent walks in which the LIS goes West is tuT (w, tw, u).

4. Finally, the generating function of prudent walks in which the LIS goes North is analogous to Case (4) of 3-sided walks ending on the top, with generating function:

wt u -tv (uT (u, v, w) -tvT (tv, v, w)) + wt v -tu (vT (u, v, w) -tuT (u, tu, w)) -twT (u, v, w).
Adding the 4 terms provides the functional equation for T (u, v, w), given the obvious symmetry T (u, v, w) = T (v, u, w). The expression for P (t; u) again relies on an inclusion-exclusion argument, based on the enumeration of walks ending on a prescribed set of edges of their box.

Triangular prudent walks

Lemma 4. The generating function R(t; u, v) ≡ R(u, v) of triangular prudent walks ending on the right edge of their box satisfies

1 - tuv(1 -t 2 )(u + v) (u -tv)(v -tu) R(u, v) = 1+tu(1+t) v -2tu v -tu R(u, tu)+tv(1+t) u -2tv u -tv R(tv, v). ( 4
)
The generating function of triangular prudent walks, counted by the length and the size of the box, is

P (t; u) = 1 + 3R(t; u, u) -3R(t; u, 0). ( 5
)
Proof. We partition the set of prudent walks ending on the right edge of their box into 7 subsets, depending on the existence and direction of the last inflating step. 1. There is no inflating step: the walk is empty, and contributes 1 to the generating function.

2. The LIS is a NW step. This implies that the endpoint of the walk was on the left edge of the box before that step. Thanks to the obvious symmetry between walks ending on the left edge and right edge of their box, we obtain the generating function of walks of this type as tu i,j R i,j t i u i+j = tuR(tu, u).

3. The LIS is a W step. Again, the endpoint of the walk was on the left edge of the box before that step. The generating function of walks of this type is

tu i,j R i,j t i+1 u i+j = t 2 uR(tu, u).
The cases where the LIS goes SE or SW are very similar to the two previous cases. The endpoint of the walk was on the bottom edge of the box before the last inflating step. 4. The generating function of walks such that the LIS is a SE step is

tv i,j R i,j t j v i+j = tvR(v, tv).
5. The generating function of walks such that the LIS is a SW step is

tv i,j R i,j t j+1 v i+j = t 2 vR(v, tv).
We are left with the two richer cases where the LIS goes East or North-East. The endpoint of the walk was already on the right edge of the box before the last inflating step, and the LIS is followed by a bounded sequence of SE or NW steps. 6. The generating function of walks such that the LIS is an E step is

tv i,j R i,j i k=0 t k u i-k v j+k + j+1 k=1 t k u i+k v j-k = tv u -tv (uR(u, v) -tvR(tv, v)) + t 2 u v -tu (vR(u, v) -tuR(u, tu)) .
7. The generating function of walks such that the LIS goes NE is

tu i,j R i,j j k=0 t k v j-k u i+k + i+1 k=1 t k u i-k v j+k = tu v -tu (vR(u, v) -tuR(u, tu)) + t 2 v u -tv (uR(u, v) -tvR(tv, v)) .
We add the 7 terms above and note that R(u, v) = R(v, u) to obtain the functional equation for R(u, v). The expression of P (t; u) again relies on an inclusion-exclusion argument.

Enumeration and asymptotic properties of 2-sided prudent walks

In this section, we recall how the kernel method works on linear equations with one catalytic variable [START_REF] Bousquet-Mélou | Linear recurrences with constant coefficients: the multivariate case[END_REF][START_REF] Banderier | Generating functions for generating trees[END_REF][START_REF] Prodinger | The kernel method: a collection of examples[END_REF], using the example of 2-sided walks. We first recover Duchi's algebraic generating function, and then refine our enumeration to keep track of other statistics like the end-to-end distance of the walk. This section is a sort of warm-up before solving the more difficult equations of Sections 4 and 5.

Proposition 5. The generating function P (t; u) of 2-sided walks, counted by their length and by the distance between the endpoint and the NE corner of the box, is

P (t; u) = 2(1 -t 2 )(1 -t)U (1 -uU )(1 -tU )(2t -U ) - 1
where

U ≡ U (t) = 1 -t + t 2 + t 3 -(1 -t 4 )(1 -2t -t 2 ) 2t .
In particular, the length generating function is

P (t; 1) = 1 1 -2t -2t 2 + 2t 3 1 + t -t 3 + t(1 -t) 1 -t 4 1 -2t -t 2 .
Proof. We start from the functional equation of Lemma 1, written as

(1 -tu)(u -t) -tu(1 -t 2 ) T (u) = u -t + t(1 -tu)(u -2t)T (t). ( 6
)
The series U ≡ U (t) given in the proposition is the only power series in t that cancels the kernel of this equation, that is, the polynomial (1 -tu)(u -t) -tu(1 -t 2 ) . The series T (U ) ≡ T (t; U ) is well-defined. Replacing u by U in the equation cancels the left-hand side, and hence the right-hand side, giving

T (t) = U -t t(1 -tU )(2t -U ) .
Then [START_REF] Bousquet-Mélou | Walks with small steps in the quarter plane[END_REF] gives T (u), and the second equation of Lemma 1 provides P (t; u).

p n ∼ κµ n with µ = 1 ρ ≃ 2.48 and κ = ρ (3ρ -1) (3ρ + 1) (5ρ -2) ≃ 2.51.
The distance between the endpoint and the NE corner of the box in a random n-step 2-sided walk follows asymptotically a geometric law of parameter 2ρ. In particular, the average value of this distance is asymptotically constant, equal to 2ρ 1-2ρ ≃ 4.15. Let X n (resp. Y n ) denote the abscissa (resp. ordinate) of the endpoint of a random n-step 2-sided walk. Then the mean and variance of

X n + Y n satisfy E(X n + Y n ) ∼ m n, V(X n + Y n ) ∼ s 2 n,
where

m = ρ + 1 3 ρ + 1 ≃ 0.63 and s 2 = 4 (ρ + 1) 2 ρ (3 ρ + 1) 3 (1 -ρ) ≃ 0.49,
and the variable Xn+Yn-m n s √ n converges in law to a standard normal distribution. Finally,

E(X n -Y n ) = 0, V(X n -Y n ) ∼ s 2 n
, where

s 2 = ρ ρ 2 -2 (1 + ρ) (ρ 2 + ρ -1) (3 ρ -1) (1 + 3 ρ) ≃ 5.17,
and the variable Xn-Yn

s √ n
converges in law to a standard normal distribution. These asymptotic properties are in good agreement with the random 2-sided walks of Fig. 6.

Proof. We start from the expression of P (t; 1) given in Proposition 5. The singularities of P (t; 1) are found among the roots of the denominator (1 -2t -2t 2 + 2t 3 ) and those of the discriminant (1 -t 4 )(1 -2t-t 2 ). It is not hard to see that the smallest one (in modulus) is ρ, corresponding to a simple pole of the series. In the expression of P (t; u) in terms of U given in Proposition 5, this pole is found when U = 2t. This implies (1 -ρ 4 )(1 -2ρ -ρ 2 ) = (1 -4ρ 2 )/2. The asymptotic behaviour p n ∼ κµ n easily follows, with µ = ρ -1 .

To study the distance to the NE corner, consider P (t; u) (given in Proposition 5). For u in a neighborhood of 1, P (t; u) still admits ρ as its unique dominant singularity, which remains a simple pole. This gives

[t n ]P (t; u) ∼ 1 -U (ρ) 1 -uU (ρ) [t n ]P (t; 1),
with U (ρ) = 2ρ, and the result follows using a continuity theorem for probability generating functions [14, Thm. IX.1].

Then, we enrich our enumeration by taking into account the sum of the coordinates of the endpoint, using a new variable z. The functional equations of Lemma 1 become:

1 - tuz 2 (1 -t 2 ) (z -tu)(u -tz) T (t, z; u) = z z -tu + tz u -2tz u -tz T (t, z; tz), P (t, z; u) = 2T (t, z; u) -T (t, z; 0).
We solve them in the same way that we solved the case z = 1, and obtain:

P (t, z; u) = 2z 3 (1 -t 2 )(1 -tz)U (z 2 -uU )(z -tU )(2tz -U ) -1 with U ≡ U (t, z) = z 1 -tz + t 2 + t 3 z -(1 -t 2 )(1 + t -tz + t 2 z)(1 -t -tz -t 2 z) 2t .
For z in a neighborhood of 1, the radius of convergence ρ z of P (t, z; 1) is reached when U (ρ z , z) = 2zρ z , or 1 -2zρ z -2ρ 2 z + 2zρ 3 z = 0. One easily checks that P (t, z; 1) satisfies the meromorphic schema of [14, Thm. IX.9], and the limit behaviour of X n + Y n follows.

The study of the distance between the endpoint and the first diagonal is similar. We first refine the enumeration by taking into account the difference X n -Y n , using a new variable z. When establishing the functional equation satisfied by T (t, z; u) ≡ T (z; u), one must note that walks ending on the right edge of the box have generating function T (t, 1/z; u). The equations finally read

1 + tu 1 -t 2 (z -tu) (u -tz) T (z; u) = z z -tu + tzT (z; tz) - t 2 u -tz T (z; tz), (7)
P (t, z; u) = T (t, z; u) + T (t, z; u) -T (t, z; 0)
with z = 1/z. The kernel method provides a linear equation between T (z; tz), T (z; tz), involving the (quadratic) series U (z) ≡ U (t, z) that cancels the kernel of [START_REF] Bousquet-Mélou | Linear recurrences with constant coefficients: the multivariate case[END_REF]. Replacing z by 1/z gives a second linear equation, now involving T (z; tz), T (z; tz) and U (z). Thus both series T (z; tz) and T (z; tz) can be expressed in terms of U (z) and U (z). It is then straightforward to obtain expressions for T (t, z; u) and P (t, z; u) in terms of U (z) and U (z) (we recommend using a formal algebra system). In particular, each of these series is algebraic of degree 4. By an obvious symmetry argument, E(X n -Y n ) = 0. As most continuity theorems involve non-negative random variables, we consider n + X n -Y n , which is clearly non-negative, with mean n. The associated generating function is P (tz, z; 1). For z in a neighborhood of 1, the radius of convergence ρ z ≡ ρ of this series is reached when

ρ 7 z 8 + ρ 5 ρ 2 + 2 ρ -4 z 6 -ρ 3 4 ρ 2 + 5 ρ -5 z 4 + ρ ρ -2 + 5 ρ 2 z 2 -2 ρ + 1 = 0,
and is again a simple pole of P (tz, z; 1). One easily checks that we are again in the meromorphic schema of [14, Thm. IX.9], and the limit behaviour of n+X n -Y n (and consequently, of X n -Y n ) follows.

4. Enumeration and asymptotic properties of 3-sided prudent walks Proposition 7. The generating function of 3-sided walks ending on the top of their box satisfies

T (t; u, tu) = k≥0 (-1) k k-1 i=0 t 1-tq -U (uq i+1 ) k i=0 tq q-t -U (uq i ) 1 + U (uq k ) -t t(1 -tU (uq k )) + U (uq k+1 ) -t t(1 -tU (uq k+1 ))
where

U (w) ≡ U (t; w) = 1 -tw + t 2 + t 3 w -(1 -t 2 )(1 + t -tw + t 2 w)(1 -t -tw -t 2 w) 2t is the only power series in t satisfying (U -t)(1 -tU ) = twU (1 -t 2 ), and
q ≡ q(t) = U (t; 1) = 1 -t + t 2 + t 3 -(1 -t 4 )(1 -2t -t 2 ) 2t .
The generating function P (t; u) of 3-sided walks, counted by their length and by the width of the box, can be expressed rationally in terms of U (u) and T (t; u, tu) (see [START_REF] Dethridge | Prudent self-avoiding walks[END_REF]). When u = 1, this gives the length generating function as

P (t; 1) = 1 1 -2t -t 2 2 t 2 q T (t; 1, t) + (1 + t) 2 -t -t 2 q 1 -tq - 1 1 -t .
Note that the series U (t; 1) is the algebraic series that occurs in the solution of 2-sided walks (Proposition 5).

Proof. In the equation (3) satisfied by R(u, w), the only catalytic variable is u (there is no occurrence of R(•, w ′ ) with w ′ = w). Thus we can apply the standard kernel method: setting u = U (w) cancels the coefficient of R(u, v), and we are left with

twR(t, w) = U (w) -t t 1 1 -tU (w) + tT (tw, w) . (8)
Recall that T is symmetric in its two (catalytic) variables. In particular, T (tw, w) = T (w, tw).

The equation ( 2) satisfied by T (u, v) involves the series R(t, u) and R(t, v). We use [START_REF] Bousquet-Mélou | Walks confined in a quadrant are not always D-finite[END_REF] to express them in terms of U (u), U (v), T (u, tu) and T (v, tv), and obtain an equation that involves only the series T :

1 - tuv(1 -t 2 ) (u -tv)(v -tu) T (u, v) = 1 + U (u) -t t(1 -tU (u)) + U (v) -t t(1 -tU (v)) - tv v -tu -U (u) T (u, tu) - tu u -tv -U (v) T (v, tv). ( 9
)
Now both u and v play catalytic roles. We want to cancel the kernel of this new equation, namely the polynomial

K(u, v) = (u -tv)(v -tu) -tuv(1 -t 2 )
, by an appropriate choice of v. Thus v will be a function of u and t. As K(u, v) is homogeneous in u and v, the dependency of v in u is extremely simple: K(u, v) vanishes for v = qu, where q = U (t; 1) only depends on t (of course, K(u, v) also vanishes for v = u/q, but this is not a power series in t). This simplicity is crucial to writing the solution in an explicit form. Replacing v by qu in [START_REF] Bousquet-Mélou | On partitions avoiding 3-crossings[END_REF] gives

T (u, tu) = - t 1-tq -U (uq) tq q-t -U (u) T (uq, tuq) + 1 tq q-t -U (u) 1 + U (u) -t t(1 -tU (u)) + U (uq) -t t(1 -tU (uq))
.

Observe that tq/(q -t) = 1-tq 1-t 2 = 1 + O(t), while U (u) = O(t). Hence tq q-t -U (u) is invertible in the ring of power series in t with coefficients in Q

[u]. Moreover, t 1-tq -U (uq) = O(t 3
), so that we can iterate the above equation indefinitely, replacing u by uq, then by uq 2 , and so on. The net result is the expression of T (u, tu) given in the proposition.

We now seek an expression for P (t; u), which was given in terms of T (u, u), T (u, 0) and R(1, u) in the third equation of Lemma 2. We wish to express each of these series in terms of U (u) (which is known explicitly) and T (u, tu), which we have just determined. To express R(1, u) (or, equivalently, R(1, w)), we combine the case u = 1 of (3) with [START_REF] Bousquet-Mélou | Walks confined in a quadrant are not always D-finite[END_REF]. For the other two series, namely T (u, u) and T (u, 0), we specialize (9) to v = u, and then to v = 0 (using U (0) = t). Putting together the three pieces gives an expression for P (t; u) in terms of U (u) and T (u, tu), which can (for instance) be written as follows:

P (t; u) = 1 1 -2t -t 2 2 t 2 U (u)T (u, tu) + (1 + t) 2 -t -t 2 U (u) 1 -tU (u) - 2(1 -U (u))(1 + t)(1 -u) (1 -2t -t 2 )(1 -t -tu -t 2 u) t 2 T (u, tu) + (t + 1) t 1 -tU (u) - 1 1 -t . (10)
Note that the second term has a factor (u -1): this makes the specialization u = 1 obvious, and gives the announced expression of P (t; 1).

Where is the group? In the introduction (Section 1.2), we wrote that a group is associated with every linear equation with two catalytic variables, and that the group associated with 3sided walks is infinite. What is this group? It is generated by two transformations Φ and Ψ that act on ordered pairs (u, v) and leave K(u, v)/u/v unchanged:

Φ(u, v) = v 2 u , v , Ψ(u, v) = u, u 2 v .
It is easy to see that they generate an infinite group. Indeed, if one repeatedly applies Ψ • Φ to the pair (u, v), one obtains all pairs (v 2i /u 2i-1 , v 2i+1 /u 2i ) for i ≥ 0. The role of this group was first recognized in the study of Markov chains in the quarter plane [START_REF] Fayolle | Random walks in the quarter-plane: Algebraic methods, boundary value problems and applications[END_REF]. See also the more recent and combinatorial papers [START_REF] Bousquet-Mélou | Walks confined in a quadrant are not always D-finite[END_REF][START_REF] Bousquet-Mélou | Walks in the quarter plane: Kreweras' algebraic model[END_REF][START_REF] Bousquet-Mélou | Walks with small steps in the quarter plane[END_REF][START_REF] Bousquet-Mélou | On partitions avoiding 3-crossings[END_REF][START_REF] Janse Van Rensburg | Partially directed paths in a wedge[END_REF][START_REF] Mishna | Two non-holonomic lattice walks in the quarter plane[END_REF][START_REF] Mishna | Classifying lattice walks restricted to the quarter plane[END_REF]. As announced in the introduction, we now proceed to show that the series P (t; 1) is not D-finite. Proposition 8 (Nature of the g.f. and asymptotic properties of 3-sided walks). The length generating function P (t; 1) of 3-sided walks is meromorphic in the disk

D = {t : |t| < t c }, with t c = √ 2 -1.
It has infinitely many poles in this disk, and thus cannot be D-finite. On the segment (0, t c ), the poles are simple and form an increasing sequence (t i ) i≥0 that tends to t c .

The pole t 0 is the unique dominant singularity of P (t; 1) and coincides with the radius of convergence ρ of the series counting 2-sided walks (Proposition 6). Thus t 0 = ρ satisfies 1 -2ρ -2ρ 2 + 2ρ 3 = 0, and the number of n-step 3-sided walks is

p n ∼ κµ n with µ = 1 ρ ≃ 2.48
for some κ > 0.

Let W n denote the width of the box of a random n-step 3-sided walk. Then

E(W n ) ∼ m n, V(W n ) ∼ s 2 n, where m = 1 + ρ 2(1 + 3ρ) ≃ 0.31 and s 2 = 3ρ (1 + ρ) 385 -1148 ρ 2 -494 ρ 16 (ρ 2 + ρ -1) (3 ρ -1) 3 (1 + 3 ρ) 3 ≃ 1.41,
and the variable Wn-m n s √ n converges in law to a standard normal distribution.

Proof. We start from the expression of P (t; 1) given in Proposition 7. The polynomial 1 -2t -t 2 does not vanish in D (although it vanishes at t c ), and we will show below that q(t) is analytic in D, and that 1 -tq(t) does not vanish in this domain. Hence most of our analysis will focus on the series T (t; 1, t). We will prove that it is meromorphic in D, with a sequence of real positive simple poles

ρ = t 0 < t 1 < t 2 < • • • < t c satisfying t i q(t i ) q(t i ) -t i = U (q(t i ) i ).
Clearly, our first concern will be the series U (u).

• The series U (u). The quadratic equation that defines U (u) gives

U (u) = t + Ũ (u) with Ũ (u) = tuU (u) 1 -t Ũ(u) 1-t 2 , ( 11
)
which shows that both U (u) and Ũ (u) have coefficients in N[u]. In particular, for all t and u such that U (|t|; |u|) converges, U (t; u) also converges and satisfies |U (t; u)| ≤ U (|t|; |u|). For u = 1, we find that the radius of convergence of U (t; 1) = q(t) is at t c . Thus U (t; 1) is analytic in D. Moreover, we note that U (t c ; 1) = 1. The non-negativity of the coefficients of U (t; 1) = q(t) implies that |q(t)| < 1 for t ∈ D.

Consequently, for t ∈ D and i ≥ 0, the series U (t; q(t) i ) ≡ U (q i ) is (absolutely) convergent, and thus analytic in D. Moreover, tU (q i ) < t c U (t c ; 1) = t c < 1, so that 1 -tU (q i ) does not vanish in D.

• The numerator and denominator of T (t; 1, t). Recall the expression of T (t; u, tu) given in Proposition 7. Note that q(t) i → 0 as i → ∞, both as a power series in t (because q(t) = O(t)) and for every t ∈ D (because |q(t)| < 1). In particular, the term tq/(q -t) -U (q i ) = t 2 /(qt) -Ũ (q i ) converges to t 2 /(q -t). Let

D(t) = i≥0 1 - q -t t 2 Ũ (q i ) . (12)
As q-t t 2 = 1 + O(t) and Ũ (q i ) = O(t i ), this is a well-defined series in t. We write

T (t; 1, t) = N (t) D(t) (13)
with

N (t) = k≥0 (-1) k N k (t)
and

N k (t) = q -t t 2 k+1 k-1 i=0 t 1 -tq -U (q i+1 ) i>k 1 - q -t t 2 Ũ(q i ) T k (t) (14)
with

T k (t) = 1 + U (q k ) -t t(1 -tU (q k )) + U (q k+1 ) -t t(1 -tU (q k+1 ))
.

We will now prove that D(t) and N (t) are analytic in D, so that T (t; 1, t) is meromorphic.

• The series D(t) is analytic in D. As discussed above, every term of the product D(t) is analytic in D. We still need to prove that the product converges in D. For t ∈ D and |u| ≤ 1, the equations [START_REF] Duchi | On some classes of prudent walks[END_REF] imply that | Ũ (t; u)| ≤ |u| Ũ(|t|; 1). Consequently,

| Ũ (q i )| ≤ |q(t)| i Ũ (|t|; 1), (15)
with |q(t)| < 1, so that the series i | Ũ (q i )| is convergent for t ∈ D. The same holds for the product D(t).

• The series N (t) is analytic in D. It follows from the properties of q, U and Ũ that every summand N k (given by ( 14)) is analytic in D. We will prove the convergence of the series k≥0 |N k (t)| by bounding N k (t). Let us begin with T k (t). First, we note that

U (t; u) -t t(1 -tU (t; u)) = u(1 -t 2 )U (t; u) 1 -tU (t; u)
is uniformly bounded (by a constant) for t ∈ D and |u| ≤ 1: hence T k (t) is uniformly bounded by a constant for t ∈ D.

Let us now bound the infinite product occurring in N k (t). We write

i>k 1 - q -t t 2 Ũ (t; q i ) ≤ exp i>k |q -t| |t| 2 | Ũ (t; q i )| ≤ exp i>k |q -t| |t| 2 Ũ(|t|; 1)|q(t)| i ≤ exp |q -t| |t| 2 Ũ (|t|; 1)| 1 -|q(t)| < ∞.
The second inequality follows from [START_REF] Flajolet | A calculus for the random generation of labelled combinatorial structures[END_REF]. Hence it suffices to prove the convergence of

k |M k (t)| with M k (t) = q -t t 2 k+1 k-1 i=0 t 1 -tq -U (q i+1 ) .
Recall that U (t; q(t) k ) → U (t; 0) = t as k → ∞. Hence

M k (t) M k-1 (t) = q -t t 2 t 1 -tq -U (q k ) → q(q -t) 1 -tq .
Due to the positivity of the coefficients of the series q(t) = U (t; 1) and q(t) -t = Ũ(t; 1), the modulus of this ratio is strictly bounded in D by the value it takes at t c , namely 1. Thus |M k (t)/M k-1 (t)| converges, as k grows, to a limit that is less than 1: the convergence of k |M k (t)| follows, and implies that N (t) is analytic in D. Consequently, T (t; 1, t) = N (t)/D(t) is meromorphic in D. In this disk, all its singularities are poles, found among the zeroes of D(t). The product form [START_REF] Duchon | Boltzmann samplers for the random generation of combinatorial structures[END_REF] of D(t) leads us to study the zeroes of each factor, or, equivalently, the zeroes of tq/(q -t) -U (q i ).

• Zeroes of tq/(q -t) -U (q i ). We fix i ≥ 0 and focus on the real interval (0, t c ). On this interval, U (t; q(t) i ) increases from 0 to 1. The identity

tq q -t = 1 -tq 1 -t 2 = 1 - t Ũ (t; 1) 1 -t 2
shows that tq/(q -t) decreases from 1 to 1/ √ 2 < 1. Thus there exists a unique t i in (0, t c ) such that t i q(t i )/(q(t i ) -t i ) = U (q(t i ) i ). Moreover, as U (q i ) ≥ U (q i+1 ) for t ∈ (0, t c ), one has

t 0 < t 1 < t 2 < • • • < t c and t i q(t i ) q(t i ) -t i -U (q(t i ) k ) > 0 for k > i. ( 16
)
Each of these zeroes is simple, as the derivative of tq/(q -t) is negative. As T (t; 1, t) is meromorphic in D, its poles are isolated, so that the increasing sequence (t i ) i can only converge to t c . The equation satisfied by ρ := t 0 reads q(ρ) = 2ρ, which yields the cubic equation of the proposition.

• Existence of infinitely many poles. It remains to prove that each t j , for j ≥ 0, is actually a pole of T (t; 1, t) = N (t)/D(t), that is, that N (t j ) = 0. Recall the expression ( 14) of N k . For t = t j , one has U (q j ) = tq/(q -t), or, equivalently, Ũ (q j ) = t 2 /(q -t). Hence

N (t) = k≥j (-1) k N k (t).
We will show the following properties: for t = t j , (A) (-1) j N j (t) > 0, and for k > j, the signs of (-1) k N k (t) alternate, starting from a positive sign:

(-1) k-j-1 N k (t) > 0, (B) |N j+1 (t)| > |N j+2 (t)| > |N j+3 (t)| > • • •
The combination of these two properties implies that N (t j ) > 0, and in particular that t j is indeed a pole of T (t; 1, t).

Let us write t = t j , and study the sign of N k (t). We begin with the signs of T k (t) and q -t. We have already seen that U (u) -t = Ũ (u) > 0 and tU (u) < 1 for u ∈ (0, 1). In particular, T k (t) ≥ 1 and q -t > 0.

Let us move to the infinite product occurring in N k (t). Now for i > k ≥ j,

1 - q -t t 2 Ũ (q i ) = 1 - Ũ(q i ) Ũ (q j ) > 0
as q ∈ (0, 1) and Ũ (u) is an increasing function of u, for 0 < u < 1.

We are left with the sign of t/(1 -tq) -U (q i+1 ), for i ≥ 0. We will prove that, still denoting t = t j ,

U (q j+2 ) < t 1 -tq < U (q j+1 ). ( 17
)
Given that the sequence U (q i ) decreases as i grows, this gives

t 1 -tq -U (q i+1 ) < 0 for 0 ≤ i ≤ j, > 0 for i ≥ j + 1, (18)
and concludes the proof of Property (A).

The key to prove ( 17) is to observe that the function u → U (t; u) is increasing for u ∈ (0, 1), with an explicit inverse, easily derived from the quadratic equation defining U (u):

u = (U (u) -t)(1 -tU (u)) tU (u)(1 -t 2 ) .
Thus ( 17) is equivalent to

q j+2 < q(1 -tq -t 2 ) (1 -t 2 )(1 -tq) < q j+1 .
Recall that we write t = t j . Hence U (q j ) = tq/(q -t), so that

q j = (q -t -t 2 q) q(1 -t 2 )(q -t)
.

Hence we are left with proving that q(q -t -t 2 q) q -t < q(1 -tq -t 2 ) 1 -tq < (q -t -t 2 q) q -t , which is easily seen to hold: the first inequality boils down to q < 1, and the second one to q -t -t 2 q -t 3 q > 0. But the quadratic equation defining q gives q -t -t 2 q -t 3 q = tq(1

+ t)(1 -2t) > 0.
It remains to prove Property (B), that is, for k ≥ j + 2,

|N k (t)| |N k-1 (t)| = t 1-tq -U (q k ) tq q-t -U (q k ) |T k (t)| |T k-1 (t)| < 1.
First, note that the sequence (U (q k )) k is decreasing. Hence the same holds for (T k (t)) k . Thus it suffices to show that for k ≥ j + 2,

t 1 -tq -U (q k ) < tq q -t -U (q k ) .
Given ( 16) and ( 18), we are left with proving t 1 -tq < tq q -t , which boils down to q 2 < 1 and is immediate. This concludes the proof of the properties of T (t; 1, t) stated at the beginning of the proof. These properties also hold for P (t; 1), as shown by the last equation of Proposition 7.

• The asymptotic number of 3-sided walks. We have proved that T (t; 1, t) and P (t; 1) are meromorphic in D, with a smallest real positive pole at t 0 = ρ. By Pringsheim's theorem, ρ is the radius of convergence of P (t; 1). In order to prove that the coefficients of P (t; 1) behave asymptotically as κρ -n , we need to prove that there exists ε > 0 such that P (t; 1) has no singularity other than ρ in the disk of radius ρ + ε.

As P (t; 1) is meromorphic in D, its poles are isolated. Thus we only have to prove that there is no other pole of modulus ρ. Recall that all poles t of P (t; 1) are roots of tq/(q -t) = U (q i ) for some i ≥ 0. Let t be a complex number of modulus ρ, with t = ρ. The positivity of the coefficients of U (t; u) imply that for i ≥ 0,

|U (t; q i )| < U (ρ; q(ρ) i ) ≤ U (ρ; 1) while tq q -t = 1 - t Ũ (t; 1) 1 -t 2 > 1 - ρ Ũ (ρ; 1) 1 -ρ 2 = U (ρ; 1).
Hence |U (q i )| < |tq/(q -t)| for all i and t cannot be a pole.

• The width of the box. The series P (t; u) that counts 3-sided prudent walks by their length and the width of the box is given by [START_REF] Dethridge | Prudent self-avoiding walks[END_REF]. A perturbation of the singularity analysis that we have performed for P (t; 1) reveals that, for u in some neighborhood of 1, P (t; u) admits a unique dominant singularity, which is a simple isolated pole obtained when U (u) = tq/(q -t), or

t (t -1) 3 (t + 1) 3 u 2 + t 3 + 2 t 2 -2 t + 1 (t -1) 2 (t + 1) 2 u -t 1 -2 t 2 -t + t 4 + 2 t 3 .
We are again in the meromorphic schema of [14, Thm. IX.9], and the limit behaviour of W n follows.

Enumeration and asymptotic properties of triangular prudent walks

We now turn our attention to the triangular prudent walks of Fig. 3. Recall that the box of such a walk is a triangle that points North. If this box has size k, we say that the walk spans a box of size k. Proposition 9. The number of triangular prudent walks that span a box of size k is

pk = 2 k-1 (k + 1)(k + 2)!.
More precisely, the number of triangular prudent walks that span a box of size k, and end on the right edge of their box at distance i from the North corner (and thus at distance

j = k -i from the South-West corner) is ri,j =      2 k (k + 2)! 3 if i = 0 or j = 0, 2 k (k + 2)! 6 otherwise.
Proof. We specialize the functional equations of Lemma 4 to t = 1. Remarkably, the kernel of ( 4)

reduces to 1. Denoting R(u, v) = R(1; u, v), we have R(u, v) = 1 + 2u v -2u v -u R(u, u) + 2v u -2v u -v R(v, v).
This deprives us of our favourite tool (how could we cancel a kernel that reduces to 1?), but still yields a simple solution. Let Rk (u, v) be the homogeneous component of degree k in R(u, v).

With the notation ri,j used in the proposition,

Rk (u, v) = i+j=k ri,j u i v j .
The functional equation satisfied by R(u, v) is equivalent to the following recurrence of order 1:

Rk (u, v) = 2 u(v -2u) Rk-1 (u, u) -v(u -2v) Rk-1 (v, v) v -u ,
with initial condition R0 (u, v) = 1. One readily checks that the polynomial

Rk (u, v) = 2 k (k + 2)! 6 u k + v k + u k+1 -v k+1 u -v
satisfies this recursion, and yields the values ri,j given in the proposition. The expression of pk then follows using the second equation of Lemma 4.

Remark. The fact that the numbers pk grow faster than exponentially is not unexpected. In particular, given a square of size k, the number of partially directed (1-sided) walks of height k that fit in this square is (k + 1) k+2 . Indeed, such walks are completely determined by choosing the abscissas of the k vertical steps, of the starting point and of the endpoint. We now move to the length enumeration of triangular prudent walks.

Proposition 10. Set u = x(1-t) (1+tx)(1+t 2 x)
, where x is a new variable. The generating function of triangular prudent walks ending on the right edge of their box satisfies

R(t; u, tu) = (1 + xt)(1 + xt 2 ) k≥0 t ( k+1 2 ) xt(1 -2t 2 ) k (xt(1 -2t 2 ); t) k+1 xt 3 1 -2t 2 ; t k (19)
where we have used the standard notation

(a; q) n = (1 -a)(1 -aq) • • • (1 -aq n-1 ).
The generating function of triangular prudent walks, counted by their length and the size of the box, is

P (t; u) = 1 + 6tu(1 + t) 1 -t -2tu(1 + t) 1 + t (2u(1 + t) -1) R(t; u, tu) .
Comments 1. The parametrisation of u in terms of the length variable t and another variable x is just a convenient way to write R(t; u, tu). Equivalently, we have

R(t; u, tu) = (1 + Xt)(1 + Xt 2 ) k≥0 t ( k+1 2 ) Xt(1 -2t 2 ) k (Xt(1 -2t 2 ); t) k+1 Xt 3 1 -2t 2 ; t k where X ≡ X(u) = 1 -t -ut -ut 2 -(1 -t)(1 -t -2ut -2ut 2 + u 2 t 2 -u 2 t 3 ) 2ut 3 is the only power series in t satisfying u(1 + tX)(1 + t 2 X) = X(1 -t).
In particular, the length generating function of triangular prudent walks is

P (t; 1) = 6t(1 + t) 1 -3t -2t 2 1 + t (1 + 2t) R(t; 1, t) (20)
where

R(t; 1, t) = (1 + Y )(1 + tY ) k≥0 t ( k+1 2 ) Y (1 -2t 2 ) k (Y (1 -2t 2 ); t) k+1 Y t 2 1 -2t 2 ; t k (21)
and

Y = tX(1) = 1 -2t -t 2 -(1 -t)(1 -3t -t 2 -t 3 ) 2t 2 . (22)
Note that

Y = t 1 -t (1 + Y )(1 + tY ). (23)
2. The value of R(u, tu) is especially simple when

x = 1/(1 -2t 2 ), that is, for u = 1-2t 2 (1-t 2 )(1+2t) . Indeed, for this value of u, R(t; u, tu) = (1 + t -2t 2 )(1 -t 2 ) (1 -2t 2 ) 2 k≥0 t k+( k+1 2 ) (t; t) k+1 t 3 (1 -2t 2 ) 2 ; t k = 1 -t t(1 -2t)   -1 + m≥1 (1 + t m ) 1 - t 2m+1 (1 -2t 2 ) 2   .
The product form follows from the following identity [1, Corollary 2.7]:

n≥0 t ( n+1 2 ) (a; t) n (t; t) n = m≥1 (1 + t m )(1 -at 2m-1 ). (24)
This can be used to prove that neither R(t; u, tu) nor P (t; u) are D-finite. However, we will derive from [START_REF] Lawler | On the scaling limit of planar self-avoiding walk[END_REF][START_REF] Madras | The self-avoiding walk. Probability and its Applications[END_REF] the following finer result on the length generating function P (t; 1). converges in law to a standard normal distribution.

Proof of Proposition 10. The kernel of the functional equation ( 4) reads:

K(u, v) = (u -tv)(v -tu) -tuv(1 -t 2 )(u + v).
Again we want to cancel it by an appropriate choice of u and v. The kernel is not homogeneous in u and v, as it was in the case of 3-sided walks, but it has another interesting property: the curve K(u, v) = 0 has genus 0, and thus admits a rational parametrisation, namely

K(U (x), U (tx)) = 0 for U (x) = x(1 -t) (1 + tx)(1 + t 2 x)
.

Now take an indeterminate x, and set u = U (x) and v = U (tx). The series R(u, v) is welldefined (as a series in t with coefficients in R[x]). Since the kernel vanishes, it follows from (4) that 1 + tu(1

+ t) v -2tu v -tu R(u, tu) + tv(1 + t) u -2tv u -tv R(tv, v) = 0.
Recall that R(u, v) = R(v, u) for all u and v. Denoting Φ(x) = R(u(x), tu(x)), this equation can be rewritten as

Φ(x) = (1 + xt)(1 + xt 2 ) 1 -xt(1 -2t 2 ) + xt 2 (1 + xt)(1 -2t 2 -xt 3 ) (1 + xt 3 )(1 -xt(1 -2t 2 )) Φ(xt).
Iterating it gives the value [START_REF] Kennedy | A faster implementation of the pivot algorithm for self-avoiding walks[END_REF] of R(u, tu).

The expression of P (t; u) in terms of R(u, tu) follows from (5), after specializing (4) to v = u and then v = 0.

Where is the group? We have solved a new linear equation with two catalytic variables u and v. Again, two transformations Φ and Ψ leave K(u, v)/u/v unchanged:

Φ(u, v) = v 2 u(1 + v -t 2 v) , v , Ψ(u, v) = u, u 2 v(1 + u -t 2 u) .
They generate an infinite group. Indeed, if one repeatedly applies Ψ•Φ to the pair (U (x), U (tx)), one obtains all pairs (U (t 2i x), U (t 2i+1 x)) for i ≥ 0. We now proceed to show that the series P (t; 1) is not D-finite.

Proof of Proposition 11. Recall the expression (20) of P (t; 1). The denominator 1 -3t -2t 2 vanishes at ρ and will be responsible for the simple dominant pole of P (t; 1). We will see that the series R(t; 1, t) ≡ R(1, t), given by ( 21), has a larger radius of convergence than P (t; 1). More precisely, we will prove that R(1, t) is meromorphic in D, with a unique real pole at t 0 ≃ 0.288 ∈ (ρ, t c ), where 4 t 0 4 + 2 t 0 3 -6 t 0 2 -2 t 0 + 1 = 0, and infinitely many non-real poles that accumulate on a portion of the unit circle.

• The series Y (t). The square root occurring in the series Y given by [START_REF] Mishna | Classifying lattice walks restricted to the quarter plane[END_REF] vanishes at t = 1, at t = t c ≃ 0.295 and at two other points of modulus 1.83... > 1. Hence Y has radius t c , but can be analytically continued in the domain D. In this domain, Y (t) is bounded. Moreover, it is easily seen to be increasing on the segment (-1, t c ).

• The series R(1, t) is meromorphic in D. Let us write R(1, t) = N (t) D(t)
where

D(t) = (Y (1 -2t 2 ); t) ∞ = i≥0 (1 -Y t i (1 -2t 2 ))
and

N (t) = (1 + Y )(1 + tY ) k≥0 t ( k+1 2 ) Y (1 -2t 2 ) k Y t 2 1 -2t 2 ; t k (Y t k+1 (1 -2t 2 ); t) ∞ .
Clearly N (t) and D(t) are analytic in D (as |t| < 1). The cancellation of (1 -2t 2 ) does not create any singularity, as

(1 -2t 2 ) k Y t 2 1 -2t 2 ; t k = (1 -2t 2 -Y t 2 )(1 -2t 2 -Y t 3 ) • • • (1 -2t 2 -Y t k+1 ).
Hence R(1, t) is meromorphic in D, and its poles are found among the values of t such that Y (t)t ℓ (1 -2t 2 ) = 1 for some ℓ ∈ N. All poles are simple, as

Y (t)t ℓ (1 -2t 2 ) = 1 implies Y (t)t m (1 -2t 2 ) = t m-ℓ = 1 for m = ℓ.
• Real poles of R (1, t). A standard study of the functions t → Y (t) and t → 1/t ℓ /(1 -2t 2 ) on the interval (-1, t c ) reveals that the only possible real pole of R(1, t) is at t 0 ≃ 0.288 < t c , where Y (t 0 ) = 1/(1 -2t 2 0 ). This implies 4 t 0 4 + 2 t 0 3 -6 t 0 2 -2 t 0 + 1 = 0.

• Existence of infinitely many poles. Let us call a critical value any t ∈ D satisfying Y (t)t ℓ (1 -2t 2 ) = 1 for some ℓ. We have just exhibited a real critical value t 0 . Fig. 9 shows the critical values obtained for various values of ℓ. We will first prove that D contains infinitely many critical values. Then, we will show that almost of them, and in particular t 0 , are poles of R(1, t).

To prove the former point, we prove that there exist 0 < θ 0 < θ 1 < π such that every point e iθ with θ 0 < |θ| < θ 1 is an accumulation point of critical values. As Y (z) = Y (z), it suffices to consider the case θ > 0. Let θ ∈ (0, π) be of the form pπ/q for two integers p and q. Let ℓ = 2kq with k ≥ 0. Take t in the vicinity of e iθ , that is t = e iθ (1 + s) with s small. As Y is analytic in the neighbourhood of e iθ , This shows that there exists, in the neighbourhood of e iθ , a solution t of Y (t)t ℓ (1 -2t 2 ) = 1 for every (large) ℓ = 2kq. This solution reads t = e iθ (1 + s) with

Y (t)t ℓ (1 -2t 2 ) = Y (e iθ )(1 -2e 2iθ ) exp(ℓs + O(ℓs 2 ))(1 + O(s)).
s ∼ - 1 ℓ log (1 -2e 2iθ )Y (e iθ ) .
However, t will only be critical if it lies in D, that is, if |t| < 1. But

|t| 2 = 1 - 2 ℓ log |1 -2e 2iθ ||Y (e iθ )| + o(ℓ -1 ), so that t is critical (for ℓ large) if and only if f (θ) := |1 -2e 2iθ ||Y (e iθ )| > 1.
The function f is continuous on (0, π). Moreover, at t = e iπ/2 , one has (1 -2t 2 ) = 3 and Y (t) = -1 + i ± e -iπ/4 , so that f (π/2) > 1. This proves the existence of an interval (θ 0 , θ 1 ) where every point θ satisfies f (θ) > 1 and is thus an accumulation point of critical values. Fig. 10 shows a plot of f (θ), and gives estimates for the best possible values θ 0 ≃ 0.59 and θ 1 ≃ 2.28, in good agreement with Fig. 9.

N (t) = (1 + Y )(1 + tY ) k≥0 t ( k+1 2 ) t -kℓ t 2-ℓ (1 -2t 2 ) 2 ; t k (t k+1-ℓ ; t) ∞ .
If k < ℓ, the kth summand is zero because of the term (t k+1-ℓ ; t) ∞ . We thus take k = ℓ + j, with j ≥ 0. We also rewrite (1 + Y )(1 + tY ) using [START_REF] Mishna | Two non-holonomic lattice walks in the quarter plane[END_REF]. This gives

N (t) = t -1-( ℓ+1 2 ) 1 -t 1 -2t 2 t 2-ℓ (1 -2t 2 ) 2 ; y ℓ (t; t) ∞ j≥0 t ( j+1 2 ) (t; t) j t 2 (1 -2t 2 ) 2 ; t j = t -1-( ℓ+1 2 ) 1 -t 1 -2t 2 t 2-ℓ (1 -2t 2 ) 2 ; t ℓ (t; t) ∞ m≥1 (1 + t m ) 1 - t 2m+1 (1 -2t 2 ) 2 .
The final product expression relies on [START_REF] Nijenhuis | Combinatorial algorithms[END_REF].

Could this product vanish for our critical value t ∈ D? As |t| < 1, the only factors that might be zero are of the form 1 -t j /(1 -2t 2 ) 2 , for j ≥ 2 -ℓ. Each such factor has only a finite number of zeroes in D. In particular, those for which j < 0, taken together, will only vanish for a finite number of critical values, while there are infinitely many such values. For j ≥ 0, the roots of 1 -t j /(1 -2t 2 ) 2 that lie in the unit disk satisfy |1 -2t 2 | < 1. That is, they are inside the 'glasses' curve |1 -2t 2 | = 1 plotted on Fig. 11. In particular, they remain away from the accumulation points we have exhibited on the unit circle, so that only finitely many critical values are non-poles.

Could t 0 , the unique critical value found on the segment (-1, t c ), not be a pole? For t = t 0 , one has

t j (1-2t 2 ) 2 ≥ 1 (1-2t 2 ) 2 > 1 for j ≤ 0, t j (1-2t 2 ) 2 ≤ t (1-2t 2 ) 2 ≃ 0.4 < 1 for j ≥ 1.
- Hence N (t 0 ) = 0, so that t 0 is indeed a pole of R(1, t), and, by Pringsheim's theorem, its radius of convergence.

• The singular landscape of R(1, t) and P (t; 1). We can now conclude as to the nature of the series R(1, t): this series is meromorphic in the domain D, with a dominant pole at t 0 and infinitely many poles that accumulate on a portion of the unit circle, {e iθ : θ 0 < |θ| < θ 1 }.

In view of (20), the same holds for the series P (t; 1), with t 0 replaced by ρ as the denominator 1 -3t -2t 2 induces a new pole ρ < t 0 . This is illustrated in Fig. 11. Clearly, P (t; 1) has no other pole of modulus less that t 0 . Hence the number of n-step triangular prudent walks is, as announced, asymptotic to κρ -n .

• The size of the box. Consider the expression of P (t; u) given in Proposition 10. The singular pattern we have found for u = 1 persists when u is in a neighborhood of 1. The radius of R(u, tu) is reached when Xt(1 -2t 2 ) = 1, but the pole of P (t; u) given by the cancellation of 1 -t -2tu(1 + t) is smaller in modulus. We are again in the meromorphic schema of [14, Thm. IX.9], and the limit behaviour of S n follows.

Random generation

Generating trees and random generation

A generating tree is a rooted tree with labelled nodes satisfying the following property: if two nodes have the same label, the multisets of labels of their children are the same. Given a label ℓ, the multiset of labels of the children of a node labelled ℓ is denoted Ch(ℓ). The rule that gives Ch(ℓ) as a function of ℓ is called the rewriting rule of the tree.

Consider a class C of walks closed by taking prefixes: if w belongs to C, then so do all prefixes of w (this is the case for our classes of prudent walks). One can then display the elements of C as the nodes of a generating tree: the empty walk sits at the root of the tree, and the children of the node labelled by w are the walks of the form ws belonging to C, where s is a step. Fig. 12 (top) shows the first few levels of the generating tree of 2-sided walks. An even simpler example is the tree of directed walks (walks with N and E steps), which has the following rewriting rule: w → wN wS .

In this context, the (uniform) random generation of a walk of C of size n is equivalent to the random generation of a path of length n in the tree, starting from the root. This path can be built recursively as follows: one starts from the empty walk (the root of the tree), and builds ws∈Ch(w) Ex(ws, m -1) otherwise. This is the basic principle of recursive random generation, initiated in [START_REF] Nijenhuis | Combinatorial algorithms[END_REF]. The (time and space) complexity of the procedure that generates an n-step walk of C depends on how efficiently one solves the following two problems:

(1) compute the numbers Ex(w, m), for all walks w of length n -m, (2) given a walk w of length less than n, decide which steps s are admissible, that is, are such that ws belongs to Ch(w). We will explain how both tasks can be achieved by introducing good labellings of the class C. A function L defined on C is a good labelling if for all w ∈ C, the multiset {L(w ′ ) : w ′ ∈ Ch(w)} depends only on L(w). This means that the tree obtained by replacing each node w of the generating tree by L(w) is itself a generating tree. We will illustrate this discussion with the class of 1-sided walks.

(1) The numbers Ex(w, m). When C is the class of 1-sided walks, these numbers only depend on the direction (horizontal or vertical, H or V for short) of the final step of w (and of course on m). Denote this direction by L(w). Then it is easy to see that L is a good labelling: the tree obtained by replacing each node w of the generating tree by L(w) is itself a generating tree, with rewriting rule

V →    V H H , H → V H . (25)
(By convention, the label of the empty walk is set to V .) For a general class C, any good labelling L allows us to compute the numbers Ex(w, m). Indeed, they can be rewritten as Ex(L(w), m), with Ex(ℓ, m) = 1 if m = 0, ℓ ′ ∈Ch(ℓ) Ex(ℓ ′ , m -1) otherwise. [START_REF] Prodinger | The kernel method: a collection of examples[END_REF] In the case of partially directed walks, we have Ex(V, m) = Ex(V, m -1) + 2 Ex(H, m -1), Ex(H, m) = Ex(V, m -1) + Ex(H, m -1).

A good labelling is compact if it takes its values in Z k , with k fixed. In this case, it is usually easy to determine Ch(ℓ), given ℓ. In order to fasten the computation of the extension numbers, one tries to minimize the number of distinct labels L(w) occurring in the first n levels of the generating tree. This solves Problem (1) above.

(2) Admissible steps. We are left with the second problem: determine the admissible steps. Moreover, we also need to decide, for every admissible step s, which of the elements of Ch(L(w)) is the label of ws. That is, we need a way to correlate new steps with new values of the label.

In our random generation procedures, this will be achieved thanks to a second good labelling P having the following properties:

-it refines the first one; that is, P (w) = (L(w)|M (w)), and the rewriting rule of P extends that of L, -the last step of w is S(P (w)), for a simple function S. For instance, in the case of 1-sided walks, we keep the label V for walks ending with a vertical step, but introduce two versions of H, namely (H | 1) (for a final E step) and (H | -1) (for a final W step), and refine the rule (25) as follows:

V →    V (H | 1) (H | -1) , (H | 1) → V (H | 1) , (H | -1) → V (H | -1) .
The last step function is given by S(V ) = N , S(H | 1) = E, S(H | -1) = W . This new rewriting rule is less compact than [START_REF] Préa | Exterior self-avoiding walks on the square lattice[END_REF], and not needed for the calculation of the extension numbers (why compute and store separately Ex((H | 1), m) and Ex((H | -1), m) while they are equal?). However, it is needed for the generation stage.

In our random generation procedures below we use the L-labels to compute the extension numbers, and the P -labels to determine the admissible steps and associate with them the correct new label. Accordingly, the algorithm involves two procedures:

• The procedure Ex(ℓ, m) computes the extension numbers using (26),

• The generation procedure reads (denoting p od: Since all our procedures have this form, the following sections only describe the labellings L and P that we use for each class of walks. In all cases, the number of children of a P -label is bounded, so that the generation procedure is achieved in linear time. We first discuss the simple case of 2-sided walks, and then the more complex case of general prudent walks (on the square lattice). Once the principles underlying the corresponding labellings are understood, it is not difficult to adapt them to 3-sided prudent walks and to triangular prudent walks.

Two-sided prudent walks

A non-empty 2-sided walk w can be of three different types, I, C or F , depending on the nature of its final step s:

(I) either s is an inflating step, which moves the North or East edge of the box;

Figure 3 .

 3 Figure 3. Left: A triangular prudent walk in a box of size 7. Right: The two catalytic parameters involved in the enumeration.

Figure 4 .

 4 Figure 4. Random prudent walks.

Figure 5 .

 5 Figure 5. Catalytic variables for k-sided walks, k ≥ 2.

Figure 6 .

 6 Figure 6. Random 2-sided walks of length 500, 1354 and 3148. Proposition 6 (Asymptotic properties of 2-sided walks). The length generating function of 2-sided walks has a unique singularity of minimal modulus, ρ ≃ 0.403, which is a simple pole and satisfies 1 -2ρ -2ρ 2 + 2ρ 3 = 0. The number of n-step 2-sided walks satisfies

Figure 7 .

 7 Figure 7. Random 3-sided walks of length 400.

Figure 8 .

 8 Figure 8. Random triangular prudent walks of length 500.

Figure 9 .

 9 Figure 9. The roots of Y (t)t ℓ (1 -2t 2 ) = 1 lying inside the domain D for ℓ = 20, ℓ = 30, ℓ = 200.

Figure 10 .

 10 Figure 10. The function f (θ) := |1 -2e 2iθ ||Y (e iθ )|. Let t ∈ D satisfy Y (t)t ℓ (1 -2t 2 ) = 1. Then t is a pole of R(1, t) if and only if N (t) = 0. But

Figure 12 .

 12 Figure 12. The generating tree of 2-sided walks (top) and one of its good labellings (bottom).

[ 1 ]

 1 = ℓ for a P -label p = (ℓ|m)): gen:=proc(n) Initialisation w:=[]: p:=P(w): ℓ:=p[1]: m:=n: while m>0 do [p 1 ,. . ., p k ]:= Ch(p): for i from 1 to k do ℓ i :=p i [1] od: U:=Uniform(0,1): d:=U*Ex(ℓ,m): i:=1: while d> Ex(ℓ 1 ,m-1) +• • • +Ex(ℓ i ,m-1) do i:=i+1: od: p:=p i : s:=S(p): w:=ws:

  Proposition 11 (Nature of the g.f. and asymptotic properties of triangular prudent walks). The length generating function P (t; 1) of triangular prudent walks is meromorphic in the domain D = {t : |t| < 1} \ [t c , 1), where t c ≃ 0.295... is the real root of 1 -3t -t 2 -t 3 . In this domain, it has infinitely many poles, so that it cannot be D-finite. These poles accumulate on a portion of the unit circle, so that P (t; 1) has a natural boundary.

	The series P (t; 1) has a unique dominant singularity, which is a simple pole ρ = ( √ 17-3)/4 ≃ 0.280. Hence the number of triangular prudent walks of length n satisfies
			p n ∼ κ	3 +	2 √ 17	n
	for some positive constant κ.
	Let S n denote the size of the box of a random n-step prudent walk. Then the mean and
	variance of S n satisfy where	m =	E(S n ) ∼ m n, 1 2 1 + 1 √ 17	V(S n ) ∼ s 2 n, and s 2 = 12 17 √ 17	,
	and the variable Sn-m n s √ n

  Figure 11. The singular landscape of P (t; 1): this series is meromorphic inside the unit disk except on a cut [t c , 1), with t c ≃ 0.295. There are two simple poles on the real axis before t c , namely ρ ≃ 0.280 and t 0 ≃ 0.288. Almost all critical values, which accumulate on a portion of the unit circle, are simple poles. The 'glasses' curve is |1 -2t 2 | = 1. To the right, a zoom in the neighbourhood of 0.28.

		1			0.1
	0.8			0.08
	0.6			0.06
	y			y
	0.4			0.04
	0.2			0.02
	-1 -0.8 -0.6 -0.4 -0.2	0	0.2 0.4 0.6 0.8	1	0	0.22 0.24 0.26 0.28 0.3 0.32 0.34 0.36 0.38 0.4
	-0.2	x		-0.02	x
	-0.4			-0.04
	-0.6			-0.06
	-0.8			-0.08
		1			-0.1

As noticed by Uwe Schwerdtfeger, we actually require this to hold as well for non-integral points, that is, when the walk is considered as a continuous process. The aim of this is to avoid considering the walk ESW, among others, as a 3-sided walk.

Acknowledgements. I am indebted to Tony Guttmann for discussions on prudent walks, which gave a new impulse to my interest in these objects.

MBM was partially supported by the French "Agence Nationale de la Recherche", project SADA ANR-05-BLAN-0372. 1

(C) or s walks along the North or East edge of the box, moving the endpoint closer to the NE corner, (F ) or s walks along the North or East edge, moving the endpoint further away from the NE corner. We label w by L(w) = (T ; i), where T is the type of w, and i is the distance of the endpoint of w to the NE corner of its box. It is not hard to realize that L is a good labelling: the labels of the children of a node w of the generating tree only depend on L(w). These labels are described by the following rewriting rule:

We do not define the label of the empty walk. Two of its four children have label (I; 0) (corresponding to North and East steps), while the other two (corresponding to South and West steps) have label (F ; 1). The top of the label based tree is shown in Fig. 12 (bottom).

The number of extensions of length m of a walk labelled ℓ can now be computed using [START_REF] Prodinger | The kernel method: a collection of examples[END_REF]. For a walk of length m and label (T ; i), one has i ≤ m. Hence O(n) different labels occur in the first n levels of the tree, and the calculation of the extension numbers Ex(ℓ, m) needed to generate a random walk of length n requires O(n 2 ) operations.

The L-label L(w) does not determine the last step s of w. For the generation stage, we refine it by defining P (w) = (L(w) | s). The last step function is of course S(P (w)) = s. The generating tree based on the labelling P has rewriting rule:

We have written s = 0 (resp. 1, 2, 3) for a North (resp. East, South, West) step. The four children of the root have labels (I; 0 | 0), (I; 0 | 1), (F ; 1 | 2), (F ; 1 | 3).

Remark. As shown in [START_REF] Duchi | On some classes of prudent walks[END_REF], the language on the alphabet {N, S, E, W } that naturally encodes 2sided walks is non-ambiguous context-free. This implies that one can generate these walks using another type of recursive approach, based on factorisations of the walks [START_REF] Flajolet | A calculus for the random generation of labelled combinatorial structures[END_REF]. This approach achieves a better complexity than our naive step-by-step construction: only O(n) operations are needed in the precalculation stage. Moreover, it can be optimized further using the principles of Boltzmann approximate-size sampling [START_REF] Duchon | Boltzmann samplers for the random generation of combinatorial structures[END_REF]. As the other classes of prudent walks we have studied cannot be described by context-free grammars, we have focussed above on the step-bystep recursive approach. Independently, we have also implemented the Boltzmann approach, which produced the second and third walks of Fig. 6.

General prudent walks on the square lattice

A non-empty prudent walk w can be of two different types, I or A, depending on the nature of its final step s:

(I) either s is an inflating step, which moves one of the edges of the box, (A) or s walks along one of the edges of the box. Consider the last edge of the box that has moved while constructing w. Say it is the North edge (the other cases are treated similarly after a rotation). Then w ends on this edge. If the final step s is inflating (North), or walks along the top edge in clockwise direction (East), let i (resp. j) be the distance between the endpoint of w and the NE (resp. NW) corner of the box. Otherwise, s walks along the top edge in a counterclockwise direction (West): exchange the roles of i and j. The top edge has length i + j. Let h the other dimension of the box. We label w by L(w) = (I; {i, j}, h) if w is inflating, by L(w) = (A; i, j, h) otherwise. If i = j, the set {i, j} has to be understood as the multiset where i is repeated twice.

It is not hard to realize that the labels of the children of a node w only depend on L(w). These labels are described by the left part of the rewriting rules given below (ignoring for the moment what follows the vertical bar). As i, j and h are bounded by n, the calculation of the extension numbers needed to generate a random walk of length n will require O(n 4 ) operations.

The label L(w) does not determine the last step s of w. For the generating stage, we refine it into a P -label as follows:

-for a walk of type I, we keep track of the ordered pair (i, j) and of the last step s; hence the P -label reads (I; {i, j}, h | i, j, s), -for a walk of type A, we keep track of the last step s and of its direction d around the box (d = 1 if s goes in a clockwise direction around the box, d = -1 otherwise). The refined label thus reads (A; i, j, h | s, d). The combined rewriting rule reads:

Again, we have written s = 0 (resp. 1, 2, 3) if s goes North (resp. East, South, West), and these values are taken modulo 4. The four children of the root have labels (I; {0, 0}, 1 | 0, 0, s) for s = 0, 1, 2, 3.

Three-sided prudent walks

A non-empty 3-sided walk can be of five different types, I v , I h , A, C, or F , depending on the nature of its final step s:

(I v ) either s is a vertical inflating step (it moves the North edge of the box), (I h ) or s is a horizontal inflating step (it moves the East or West edge of the box), (A) or s walks along the top edge, (C) or s walks upwards on a vertical edge, moving the endpoint of the walk closer to the top end of the edge, (F ) or s walks downwards on a vertical edge, moving the endpoint further away from the top end of the edge. For a walk w of type I v or A, we denote by i and j the distances between the endpoint of the walk and the NE and NW corners, with the same convention as for general prudent walks (Section 6.3). Otherwise, i denotes the distance between the endpoint of w and the top end of the vertical edge where w ends, and j denotes the width of the box. The label of a walk w of type T is L(w) = (I v ; {i, j}) if T = I v and (T ; i, j) otherwise. Then L is a good labelling, described by the first part of the rewriting rules given below. The calculation of the extension numbers needed to generate a random walk of length n requires O(n 3 ) operations.

The L-labelling does not determine the last step s of w. For the generating stage, we refine it as follows:

-for a walk of type I v , we keep track of the ordered pair (i, j), -for a walk of type A or I h , we keep track of the last step s, -for a walk of type C or F , we keep track of the direction d of the last step around the box: d = 1 if the last step goes in a clockwise direction around the box or consists only of South steps, d = -1 otherwise.

The last step is explicitly given by the refined label for types A and I h , and is otherwise obtained via the last step function S defined by S(I v ; . . .) = S(C; . . .) = 0, S(F ; . . .) = 2. The generating rules read, with the notation ( 27):

The four children of the root have labels (I h ; 0, 1|1), (I h ; 0, 1|3), (I v ; {0, 0}|0, 0) and (F ; 1, 0|1).

Triangular prudent walks

The principles that underlie the generation of triangular prudent walks are the same as for prudent walks on the square lattice (Section 6.3). The type of a walk w depends on whether its last step s is inflating (type I) or walks along the box (type A). Consider the last edge of the box that has changed while constructing w. Assume it is the right edge (the other cases are treated similarly after a rotation). If s points up (NW or NE), then i (resp. j) denotes the distance between the endpoint of w and the top vertex (resp. bottom right vertex) of the box. Otherwise, the roles of i and j are exchanged. Define L(w) = (T ; i, j), where T is the type of w. Then L is a good labelling. From this, one computes the extension numbers needed to generate a walk of length n in time O(n 3 ).

During the generation stage, we also keep track of the last step s of w, and of its direction d around the box: if the last edge that has changed is the right one, then d = 1 if s goes East of South-East, d = -1 otherwise. The other cases are treated similarly after a rotation. The combined rewriting rules read:

Again, the steps are encoded by 0, 1, . . . , 5 in clockwise order, and considered modulo 6. The NW step is encoded by 0. The six children of the root have labels (I; 0, 1 | s, d), with (s, d) = (0, -1), (1, 1), (2, -1), (3, 1), (4, -1), (5, 1).

Some questions and perspectives

The enumeration of general prudent walks remains an open problem, although we have established a functional equation defining their generating function (Lemma 3). Recall that this g.f. is expected to be non-D-finite, and to have the same radius of convergence as the g.f.s of 2-sided and 3-sided walks (Propositions 6 and 8) [START_REF] Dethridge | Prudent self-avoiding walks[END_REF].

It may be worth investigating the number of prudent walks that span a given box. This number is indeed simple in the case of triangular prudent walks (Proposition 9), even though the length generating function is not D-finite.

Regarding random generation, we think that we have optimized the step-by-step recursive approach. However, it only provides walks with a few hundred steps. We believe that a better understanding of our results, and of the combinatorics of prudent walks, should lead to more efficient sampling procedures.

All the walks we have been able to count move away from the origin at a positive speed. Would it be possible to introduce a non-uniform distribution on these walks that would make them significantly more compact? Recall that the end-to-end distance in an n-step self-avoiding walk is expected to grow like n 3/4 only.

In the same spirit, it should be possible to study kinetic versions of prudent walks, where at each tick of the clock, the walk takes, with equal probability, one of the available prudent steps. The resulting distribution on n-step walks is no longer uniform. This version is actually the one that was studied in [START_REF] Turban | Self-directed walk: a Monte Carlo study in two dimensions[END_REF] and [START_REF] Santra | Directed self-avoiding walks in random media[END_REF]. Clearly, the random generation of these kinetic walks can be performed in linear time, and does not require any precomputation (in terms of generating trees, one chooses uniformly one of the children). Random trajectories differ significantly from the uniform case (Fig. 13). Their behaviour has very recently been explained by Beffara et al. [START_REF] Beffara | Scaling limit of the prudent walk[END_REF].