Sophie Morier-Genoud

Valentin Ovsienko

q-DEFORMED RATIONALS AND q-CONTINUED FRACTIONS

We introduce a notion of q-deformed rational numbers and q-deformed continued fractions. A q-deformed rational is encoded by a triangulation of a polygon and can be computed recursively. The recursive formula is analogous to the q-deformed Pascal identitiy for the Gaussian binomial coefficients, but the Pascal triangle is replaced by the Farey graph. The coefficients of the polynomials defining the q-rational count quiver subrepresentations of the maximal indecomposable representation of the graph dual to the triangulation. Several other properties, such as total positivity properties, q-deformation of the Farey graph, matrix presentations and q-continuants are given, as well as a relation to the Jones polynomial of rational knots. Contents 4.9. Proof of Proposition 1.8 24 5. q-analogues of the continuants 25 5.1. Euler's continuants 25 5.2. Introducing q-deformed continuants 26 5.3. Euler's identities for the q-deformed continuants 27 6. Two examples of infinite sequences: q-Fibonacci and q-Pell numbers 28 6.1. Sequence A079487 and its mirror A123245 28 6.2. Quantization of the ratio of Fibonacci numbers 29 6.3. A q-deformation of the Pell numbers 29 7. Closing remarks and open questions 30 Appendix A. Jones polynomial and q-continued fractions 31 Appendix B. Ptolemy relations and q-continued fractions 35 References 39 . . . -1 c k , with c i ≥ 2 and a i ≥ 1, denoted by [a 1 , . . . , a 2m ] and c 1 , . . . , c k , respectively. They are usually called regular and negative (or "minus-") continued fractions, respectively. Considering an even number of

Introduction 1. Introducing q-deformed rationals and continued fractions 1.1. The main definition 1.2. Total positivity 1.3. Basic properties of the polynomials R and S 1.4. The special value q = -1 2. Weighted triangulations and q-deformed continued fractions 2.1. Continued fractions and the triangulations T r/s 2.2. The Farey sum rule 2.3. Weighted triangulations T q r/s 2.4. Labeling the vertices of T q r/s 2.5. Weighted Farey sum 2.6. Weighted Farey graph 2.7. A comparison to the Gaussian q-binomial coefficients 3. Counting on graphs 3.1. Oriented graph associated with a rational 3.2. Closure subsets 3.3. A reformulation with quiver representations 3.4. Proof of Theorem 4 4. Matrices of continued fractions and their q-deformations 4.1. Matrices of convergents 4.2. q-deformation of the matrices of convergents 4.3. q-deformation of the generators 4.4. Local surgery operations 4.5. Solving the equation M q (c 1 , . . . , c n ) = ±q Id 4.6. Proof of Theorem 1 4.7. Proof of Theorem 2 4.8. The weight of two neighbours Key words and phrases. q-rationals, q-continued fractions, total positivity, Farey tessellation, quiver representations.

Introduction

Let q be a formal parameter, recall the classical notion of q-integers:

[a] q := 1 -q a 1 -q = 1 + q + q 2 + • • • + q a-1 ,
where a is a non-negative integer. Surprisingly, a similar notion in the case of rational numbers is missing in the literature. A straightforward attempt to q-deform a rational number r s would be

[r]q

[q]s , or q r s -1 q-1 , (which is essentially the same formula modulo rescaling). In those formulas the numerator and denominator are q-deformed separately, as q-integers. However, such definitions would not satisfy interesting combinatorial properties.

The goal of this paper is to define a version of q-analogue of rational numbers, using a combinatorial approach. In our approach the numerator and denominator affect each other's q-deformation. The q-deformation of a rational r s is a quotient of two polynomials: r s q = R(q) S(q) , where R and S both depend on r and s. The simplest example to illustrate this is: 5 2 q = 1 + 2q + q 2 + q 3 1 + q , 5 3 q = 1 + q + 2q 2 + q 3 1 + q + q 2

where the "quantized" 5 in the numerator is different depending on the denominator. The notion of q-rational we introduce has a certain similarity to that of the classical Gaussian qbinomial coefficient r s q , which is a polynomial depending on r and s that q-deforms the usual binomial coefficient r s . This similarity manifests in the comparison of the weighted Farey sum rule and the qversion of Pascal's triangle. However, the Farey graph is more complicated than the Pascal triangle, since every rational has infinitely many neighbors.

The main properties of the q-rationals we consider are the following.

A q-deformed rationals satisfy a total positivity property. For every rational r s , both polynomials R and S in the numerator and denominator of r s q have positive integer coefficients. Moreover, for two rationals, r s > r s , the polynomial RS -SR has positive integer coefficients (see Theorem 2).

B There is an "enumerative interpretation" of the q-rationals (Theorem 4). Coefficients of the polynomials in the numerator and denominator count so-called closure sets of a certain graph. This is also equivalent to counting subrepresentations of the maximal indecomposable quiver representation. In addition, we obtain q-analogues of several classical notions and results.

(a) Theorem 1 provides a relationship between regular and negative continued fractions, generalizing the formulas from [START_REF] Hirzebruch | Hilbert modular surfaces[END_REF][START_REF] Hirzebruch | Classification of Hilbert modular surfaces[END_REF]. (b) The weighted Farey graph. Theorem 3 generalizes the result of [START_REF] Series | The modular surface and continued fractions[END_REF] that relates continued fractions and hyperbolic geometry. (c) The q-continued fractions and q-rationals are represented by products of elementary matrices R q := q 1 0 1 , L q := 1 0 1 q -1 . S q := 0 -q -1 1 0 , that are q-deformed generators of PSL(2, Z). (d) We obtain q-analogues of the continuants (i.e., the determinants that give the numerator and denominator of a continued fraction in terms of its coefficients), and prove the Ptolemy relations generalizing the Euler identity for the continuants (see Proposition 5.5). To summarize, the results (a)-(d) of the above list give four equivalent ways to define and calculate q-rationals. These four interpretations can be used for different purposes.

We test the notion of q-rationals on the example of two particularly simple infinite sequences of rationals: the ratios of consecutive Fibonacci and Pell numbers. These are consecutive convergents of the golden ratio and those of the silver ratio. Our approach leads to certain versions of q-Fibonacci and q-Pell numbers. The Fibonacci case turns out to be related to the well-known Sequence A079487 of OEIS (and its mirror A123245), while the obtained version of q-Pell numbers seems to be new. Note that q-analogues of the Fibonacci and Pell numbers is a wast subject, and several different versions of them are known, but do not appear in our context.

The notion of q-rational introduced in this paper needs only quite elementary constructions. However, this notion arose at the interface of two theories, that of continued fractions and cluster algebra. These motivating relations are presented in two appendices in a brief form with no technical details. In Appendix A, we relate the q-rationals to the Jones polynomials of rational knots. In Appendix B, we relate the q-rationals to the F -polynomials of a cluster algebra.

This paper is the second part of [START_REF] Morier-Genoud | Continued fractions and triangulations, modular group and polygon dissections[END_REF] where we discussed combinatorial properties of continued fractions. However, it can be read independently.

Introducing q-deformed rationals and continued fractions

In this section we define q-deformations of finite continued fractions and formulate their first basic properties.

1.1. The main definition. Given a rational number r s ∈ Q, we always assume r s > 1 and that r and s are positive coprime integers. It has two different continued fraction expansions

r s = a 1 + 1 a 2 + 1 . . . + 1 a 2m = c 1 - 1 c 2 - 1
coefficients in the regular expansion and coefficients greater than 2 in the negative expansion make the expansions unique. We define q-deformations of the regular and negative continued fractions. We start with an explicit formula; equivalent, but more combinatorial, definitions will be given in Sections 2 and 3. Definition 1.1. (a) Given a regular continued fraction [a 1 , . . . , a 2m ], we define its q-deformation by

(1.1) [a 1 , . . . , a 2m ] q := [a 1 ] q + q a1 [a 2 ] q -1 + q -a2 [a 3 ] q + q a3 [a 4 ] q -1 + q -a4 . . . [a 2m-1 ] q + q a2m-1 [a 2m ] q -1
(b) Given a negative continued fraction c 1 , . . . , c k , we define its q-deformation by

(1.2) c 1 , . . . , c k q := [c 1 ] q - q c1-1 [c 2 ] q - q c2-1 . . . . . . [c k-1 ] q - q c k-1 -1 [c k ] q
The following statement will be proved in Section 4.6.

Theorem 1. If a positive continued fraction [a 1 , . . . , a 2m ] and a negative continued fraction c 1 , . . . , c k represent the same rational number, then their q-deformations also coincide:

[a 1 , . . . , a 2m ] q = c 1 , . . . , c k q .

In other words, the explicit formula (see [START_REF] Hirzebruch | Hilbert modular surfaces[END_REF][START_REF] Hirzebruch | Classification of Hilbert modular surfaces[END_REF]) for conversion between the coefficients a's and c's remains unchanged in the q-deformed case. This formula will be recalled in Section 2.1.

Given a rational number r s = [a 1 , . . . , a 2m ] = c 1 , . . . , c k , the rational function defined by (1.1) and (1.2) will be called the q-deformation of r s , or simply a q-rational. We will use the notation

(1.3) r s q =: R(q) S(q) ,
where R and S are polynomials in q with integer coefficients. We always assume that (after a possible simplification) R and S are coprime in Z[q], and that

R(1) = r, S(1) = s.
This fixes the sign in a unique way so that R and S are uniquely determined. Let us start with simple examples.

Example 1.2. (a) The cases s = 1 and s = r -1 are the only cases where r s q coincides with the quotient of the q-deformed integers standing in the numerator and denominator:

r r -1 q = [r] q [r -1] q .
(b) The first non-trivial examples are

5 2 q = 3, 2 q = [2, 2] q = 1+2q+q 2 +q 3 1+q , 5 3 q = 2, 3 q = [1, 1, 1, 1] q = 1+q+2q 2 +q 3 1+q+q 2 , 7 3 q = 3, 2, 2 q = [2, 3] q = 1+2q+2q 2 +q 3 +q 4 1+q+q 2 , 7 4 q = 2, 4 q = [1, 1, 2, 1] q = 1+q+2q 2 +2q 3 +q 4 1+q+q 2 +q 3 , 7 5 q = 2, 2, 3 q = [1, 2, 1, 1] q = 1+q+2q 2 +2q 3 +q 4 1+q+2q 2 +q 3
.

(c) The q-rationals with denominator [START_REF] Andrews | Eight-vertex SOS model and generalized Rogers-Ramanujan-type identities[END_REF] q are:

2m+1 2 q = 1+2q+2q 2 +•••+2q m-1 +q m +q m+1
1+q .

(d) The q-rationals with denominator [START_REF] Berstel | Noncommutative rational series with applications[END_REF] q are:

3m+1 3 q = 1+2q+3q 2 +3q 3 +•••+3q m-1 +2q m +q m+1 +q m+2 1+q+q 2 , 3m+2 3 q = 1+2q+3q 2 +3q 3 +•••+3q m-1 +2q m +2q m+1 +q m+2 1+q+q 2
.

We see that the degrees of the polynomials R and S are in general lower than those of [r] q and [s] q .

1.2. Total positivity. An important property of the polynomials R and S is the following property of positivity.

Proposition 1.3. For every q-rational r s q = R(q) S(q) , the polynomials R and S have positive integer coefficients.

This property is not immediate from the expression (1.2) nor from the expression (1.1) (after simplifications minus signs may appear). We give an elementary proof below in §1.3. We will give a combinatorial interpretation of the coefficients; see Section 3.

Furthermore, Proposition 1.3 has the following strengthened version.

Theorem 2. For every pair of q-rationals, r s q and r s q

, the polynomial in q (1.4) X r s , r s := RS -SR has positive integer coefficients, provided r s > r s . This statement is proved in Section 4.7. The following corollary can be deduced by evaluating the polynomials at q = 1.

Corollary 1.4. Let r s > r s be two rationals and let R S = r s q and R S = r s q

. One has

RS -SR = q α if and only if rs -r s = 1,
for some integer α ≥ 0.

The exact value of α is given in Proposition 4.11.

Remark 1.5. (a) Theorem 2 implies a natural ordering on the set of q-rationals. (b) Theorem 2 is a manifestation of the general phenomenon of total positivity. Recall that a 2 × N matrix is totally positive if all n(n-1) 2 its 2×2 minors are positive. The quotients R(q) S(q) and R (q) S (q) naturally enter a 2 × N totally positive matrix.

(c) Theorem 2 implies Proposition 1.3, when applied to r s = 1 0 , or r s = 0 1 .

1.3. Basic properties of the polynomials R and S. Let (c i ) 1≤i≤k be a sequence of integers greater or equal to 2. Consider two sequences (R i ) i≥0 and (S i ) i≥0 of polynomials in q defined by the following recursions

(1.5) R i+1 = [c i+1 ] q R i -q ci-1 R i-1 , S i+1 = [c i+1 ] q S i -q ci-1 S i-1 ,
with the initial conditions (R 0 , R 1 ) = (1, [c 1 ] q ) and (S 0 , S 1 ) = (0, 1). As a common fact on generalized continued fractions, one observes that the above sequences define the convergents of the continued fraction c 1 , . . . , c k q . More precisely, one has

c 1 , . . . , c i q = R i (q) S i (q) ,
for all 1 ≤ i ≤ k.

Proposition 1.6. For all 1 ≤ i ≤ k, (i) the leading term of R i is q c1+...+ci-i and the constant term is 1;

(ii) the leading term of S i is q c2+...+ci-i+1 and the constant term is 1;

(iii) R i and S i have positive integer coefficients;

(iv) R i and S i are coprime.

Proof. (i) and (ii) are obtained by easy induction. Assume that R i and R i -q ci-1 R i-1 have positive integer coefficients for some fixed index i. From the recursion one gets

R i+1 = q[c i+1 -1] q R i + (R i -q ci-1 R i-1 ),
which implies that R i+1 also have positive integer coefficients, and one gets

R i+1 -q ci+1-1 R i = q[c i+1 -2] q R i + (R i -q ci-1 R i-1 ),
which implies that R i+1 -q ci+1-1 R i also have positive integer coefficients. (iii) follows then by induction.

From the following 2 × 2 determinant computations

R i+1 R i S i+1 S i = -q ci-1 R i-1 R i -q ci-1 S i-1 S i = q ci-1 R i R i-1 S i S i-1 = . . . = -q c1+...+ci-i
one deduces that the only possible common divisors to R i and S i are powers of q. Since the polynomials have constant terms 1 they are not divisible by a power of q. Hence (iv).

In particular, for i = k one obtains that R k and S k are precisely the polynomials R and S of (1.3), and one deduces the following.

Corollary 1.7. Let R(q) S(q) = [a 1 , . . . , a 2m ] q = c 1 , . . . , c k q . (i) The degrees of the polynomials R and S in (1.3) are

deg(R) = c 1 + . . . + c k -k = a 1 + . . . + a 2m -1, deg(S) = c 2 + . . . + c k -k + 1 = a 2 + . . . + a 2m -1.
(ii) The coefficients of the leading terms of R and S are equal to 1.

(iii) The constant terms of R and S are equal to 1, so that R(0) = S(0) = 1.

1.4. The special value q = -1. The value q = -1 is special. In this case we have the following.

Proposition 1.8. (i) For every rational r s , the corresponding polynomials R and S evaluated at q = -1 can take only three values: -1, 0, or 1.

(ii) R(-1) = 0 if and only if r is even.

(iii) S(-1) = 0 if and only if s is even.

We will prove this statement in Section 4.9.

A corollary of Proposition 1.8 Part (ii) is that, for even r, the polynomial R(q) is a multiple of (1 + q), and similarly for Q(q).

Weighted triangulations and q-deformed continued fractions

The goal of this section is to give an alternative, recurrent, way to define q-deformations of continued fractions. We construct a combinatorial model for calculating the q-continued fractions based on a simple triangulation of an n-gon. The main difference comparing with the classical continued fractions is that the edges of the corresponding triangulation are weighted. We show that the weights associated to q-deformed continued fractions can be read directly in the Farey graph.

2.1. Continued fractions and the triangulations T r/s . We briefly recall a relationship between continued fractions and triangulations of n-gons (for more details; see [START_REF] Morier-Genoud | Continued fractions and triangulations, modular group and polygon dissections[END_REF]).

Consider the following "wrinkled triangulation" of an n-gon with exactly two exterior triangles:

c 1 t t a2 B B c 2 c 3 • v v a4 9 9 • c k c k+1 c 0 j j a1 R R c n-1 c n-2 • h h a3 U U • c k+2
Every such triangulation defines, and is defined by, two sequences of positive integers: (a 1 , . . . , a 2m ) and (c 1 , . . . , c n ). The integers a i count the number of consecutive equally positioned triangles (i.e., the triangles "base-down", or "base-up") while the integer c i counts the number of triangles incident at the vertex i.

Let k be the number of vertices between the exterior vertices. The following statement is a reformulation of a formula from [START_REF] Hirzebruch | Hilbert modular surfaces[END_REF][START_REF] Hirzebruch | Classification of Hilbert modular surfaces[END_REF].

The regular and negative continued fractions defined by the sequences (a 1 , . . . , a 2m ) and (c 1 , . . . , c k ) coming from a triangulation, are equal to each other:

[a 1 , . . . , a 2m ] = c 1 , . . . , c k .
Equivalently, the explicit formula of conversion for the coefficients of regular and negative continued fractions is: .

(2.1) (c 1 , . . . , c k ) = a 1 + 1,
Notation. The constructed triangulation will be denoted by T r/s , where r s is the rational number defined by the above continued fractions, i.e., r s := [a 1 , . . . , a 2m ] = c 1 , . . . , c k . Remark 2.1. Note that the number n is related with the coefficients of the continued fractions by

n = a 1 + a 2 + • • • + a 2m + 2 = c 1 + c 2 + • • • + c k -k + 3.

2.2.

The Farey sum rule. The triangulation T r/s encodes the full sequence of convergents of the continued fractions via the following Farey sum rule:

(2.2) r s ⊕ r s := r + r s + s .
We label the vertices of the n-gon by rationals starting from 0 1 and 1 0 at vertices 0 and 1, and extending this labeling by the rule (2.2). The following statement is equivalent to a theorem of C. Series; see [START_REF] Series | The modular surface and continued fractions[END_REF], and it was first formulated in the context of hyperbolic geometry and a Farey tessellation: the vertex k + 1 of the triangulation T r/s has the label r s .

Example 2.2. The rationals 5 2 , 5 3 , 7 5 correspond to the following triangulations 2.3. Weighted triangulations T q r/s . Given a rational r s and the corresponding triangulation T r/s , we define the weighted triangulation T q r/s . Both, the vertices and the edges of T q r/s are assigned a weigh. The edges of the triangulation are assigned a weight, which is a power of q, while the vertices are labeled with q-rationals.

Definition 2.3. The edges are assigned weights according to the following rules.

(a) The edges at the vertex with number 1 have the following weights:

1 q -1 1 q c 1 -1 q q c 1 -2 2 • • • • • • • (b)
The edges at an upper vertex with number i ≥ 2 have the weights defined according to the following rule: i -1

q c i-1 -1 i q 2 q 1 q c i -1 q c i -2 i + 1 • • • • • • • (c)
All the edges between the bottom vertices have weight 1.

Remark 2.4. (a) The sides of the "initial" triangle ( 1 0 , 1 1 , 0 1 ) have weight 1, 1 and q -1 .

1 0 q -1 1 0 1 1 1 1
Note that the side of weight q -1 is not used in the computation of the continued fractions. The weight q -1 will become clear in Section 2.6. (b) It follows from Definition 2.3 that the edges at a bottom vertex have the following weights:

• q • 1 • 1 • • • • 1 • 1 • 1
In particular, at most one edge at a bottom vertex is of weight different from 1.

(c) Sides of every triangles have the weights (1, q , q -1 ):

• q -1 1 • q •
for some ≥ 1.

Example 2.5. The weighted triangulations T q 5/2 , T q 5/3 , T q 7/5 (see Example 2.2) are as follows

• q -1 1 q 2 q • q 1 • 1 • 1 • 1 • • q -1 1 q • 1 q 2 q • 1 • 1 • 1 • • q -1 1 q • 1 q • 1 q q 2 • 1 • 1 • 1 • 2.4.
Labeling the vertices of T q r/s . We will also need to label the vertices of the weighted triangulation T q r/s . Definition 2.6. Let us label by the q-rational r s q the vertex of T q r/s , that corresponds to the rational r s in T r/s .

The weights of T q r/s then encode algebraic relations between the fractions attached to the vertices. More precisely, we have the following statement. Theorem 3. Every triangle of T q r/s is of the form

(2.3) R S q -1 1 R S q R +q R S +q S .
Proof. We suppose that R S = [ r s ] q and R S = [ r s ] q are attached to the vertices j > k and i ≤ k respectively.

Case 1. The local picture is as follows:

i -1

q c i-1 -1 i q -1 q -2 q c i -1 q i + 1 j + 1 1 j 1 j -1
We want to show that the fraction R S attached to the vertex j -1 is given by R +q R S +q S . Recall that the coefficients of the negative continued fractions are given by the number of triangles incident to the vertices (see §2.1). In particular, for the fraction R S or R S the coefficients are given by removing all the vertices and triangles between i and j or i and j -1 respectively. More precisely one gets

R S = c 1 , . . . , c i-1 q , R S = c 1 , . . . , c i-1 , q , R S = c 1 , . . . , c i-1 , + 1 q .
The desired relations between the numerators and between the denominators are then deduced from the recurrence relations (1.5). Case 2. The local picture is as follows:

h q c-1 q c • 1 q • 1 i 1 q i + 1 1 • 1 q c-2 j 1 Note that if h = i -1 one has = c = c i-1 -1 > 1, otherwise = 1.
We want to show that the fraction R S attached to the vertex i + 1 is given by R +q R S +q S . We proceed by induction on i -h.

If h = i -1 one has R S = c 1 , . . . , c i-1 q , R S = c 1 , . . . , c i-1 -1 q , R S = c 1 , . . . , c i-1 , 2 q .
Using the recurrence relations (1.5), one easily obtains the desired relation.

If we assumed established that the fraction R (4) S (4) attached to the vertex i -1 satisfies R S = R +qR (4) S +qS (4) , then again one easily deduces the desired relation using the coefficients of the expansions and the recurrence relations.

2.5. Weighted Farey sum. We generalize the Farey sum (2.2) in the case of weighted triangulation, using the formula that has already appeared in Theorem 3. Definition 2.7. In the triangle (2.3), we call the fraction:

(2.4) R S ⊕ q R S := R + q R S + q S ,
the weighted Farey sum of R S and R S . Theorem 3 then affirms that every q-rational number r s q can be computed recursively from the triangulation T q r/s , applying the weighted Farey sum rule. Proposition 1.3 and Corollary 1.4 can be also obtained as consequences of Theorem 3.

Example 2.8. The q-rationals in T q 5/2 , T q 5/3 , T q 7/5 can be obtained recursively. One obtains the following.

1 0 q -1 1 q 2 q 1+q+q 2 1 q 1 1+2q+q 2 +q 3 1+q 1 0 1 1 1 1 1 1+q 1 1 0 q -1 1 q 1+q 1 1 q 2 q 1+q+2q 2 +q 3 1+q+q 2 1 0 1 1 1 1 1 1+q+q 2 1+q
The q-rational 7 5 q corresponds to 1 0

q -1 1 q 1+q 1 1 q 1+q+q 2 1+q 1 q q 2 1+q+2q 2 +2q 3 +q 4 1+q+2q 2 +q 3 1 0 1 1 1 1 1 1+q+q 2 +q 3 1+q+q 2
2.6. Weighted Farey graph. The classical Farey graph is the infinite graph with the set of vertices equal to the set of rationals completed by the infinity Q ∪ {∞}, the infinity being represented by 1 0 . Two vertices, r s and r s , are connected if and only if rs -r s = ±1. The Farey graph form an infinite triangulation of the hyperbolic plane, called the Farey tessellation. Every continued fraction can be understood as a walk along the edges of the Farey graph. For the basic properties of the Farey graph and its relation to continued fractions; see [START_REF] Hardy | An introduction to the theory of numbers[END_REF].

We assign a weight to every edge of the Farey graph, and then label its vertices by the q-rational numbers (instead of rational numbers). Definition 2.9. (a) The sides of the "initial" triangle ( 1 0 , 1 1 , 0 1 ) are weighted as follows

1 1 q -1 1 0 1 1 0 1 (b)
The sides of every other triangle of the Farey graph are labeled according to the following rule.

1 q ℓ q ℓ-1
Clearly, the rules (a) and (b) uniquely determine the weights of all edges of the Farey graph. Indeed, every edge is adjacent to two triangles in the Farey tessellation, and any two edges are related by a finite sequences of triangles. We will essentially be interested in the interval [0, ∞) of the Farey graph. Definition 2.9 clarifies the weights in Definition 2.3. Indeed, the triangulation T q r/s can be embedded into the Farey graph (cf. [START_REF] Morier-Genoud | Continued fractions and triangulations, modular group and polygon dissections[END_REF]), so that its weights are obtained as the pull-back of the weights on the Farey graph. Therefore vertices are labeled according to the weighted Farey sum rule:

1 q ℓ q ℓ-1 R S R+q ℓ R ′ S+q ℓ S ′ R ′ S ′
Moreover, from the embedding of T q r/s one deduces that is the last coefficient in the negative expansion of R S := R+q R S+q S , i.e. if R S = c 1 , . . . , c i q then = c i . The top part of the weighted Farey graph is represented in Figure 1.

1 1 q 1 q 1 q 2 q 3 1 1 q 1 q q 2 1 1 q -1 0 1 1 1 1 0 1+q 1 1+q+q 2 1+q 1+q+q 2 1 1+q+q 2 +q 3 1+q+q 2 1+q+2q 2 +2q 3 +q 4 1+q+2q 2 +q 3 1+q+2q 2 +q 3 1+q+q 2 1+2q+q 2 +q 3 1+q 1+q+q 2 +q 3 1 1 q 1 1 1 1 1 1 1 q 2 q q 3 q q 2 q q 4 1+2q+2q 2 +2q 3 +q 4 1+q+q 2 1+2q+2q 2 +q 3 +q 4 1+q 1+2q+2q 2 +2q 3 +q 4 1+2q+q 2 +q 3 Figure 1.
Upper part of the weighted Farey graph between 0 1 and 1 0 2.7. A comparison to the Gaussian q-binomial coefficients. There is a certain analogy between the q-continued fractions and Gaussian q-binomial coefficients. Indeed, the q-binomials r s q satisfy the relations

r s q = q s r -1 s q + r -1 s -1 q ,
and can be calculated recurrently using the "weighted Pascal triangle" that starts like this:

0 0 q 1 1 1 0 q 1 1 1 1 q 1 q 2 0 q 1 1 2 1 q 1 q 2 2 q 1 q 2 3 0 q 1 1 3 1 q 1 q 3 2 q 1 q 2 3 3 q 1 q 3 4 0 q 4 1 q 4 2 q 4 3 q 4 4 q
with the first case 4 2 q = 1 + q + 2q 2 + q 3 + q 4 where a q-binomial is not equal to a q-integer. The main difference between q-rationals and q-binomials is that, unlike the Pascal triangle, every vertex of the Farey graph is related with infinitely many other vertices. Let us mention that q-binomial coefficients do not occur as numerators (or denominators) of q-rationals, except for the those q-binomials that are equal to q-integers. Nevertheless, there are many resemblance between the polynomials, for instance, 5 3 q = 1 + q + 2q 2 + 2q 3 + 2q 4 + q 5 + q 6 and 8

3 q = 1 + 2q + 2q 2 + 2q 3 + q 4 1 + q + q 2 .

Counting on graphs

In this section we provide a combinatorial interpretation of the polynomials R and Q of a q-rational r s q . Given a rational r s , we consider an oriented graph of type A which is (projectively) dual to the triangulation T r/s . We show that the coefficients of the polynomials R(q) and Q(q) count some special subsets of vertices of the graph called "the closures". Equivalently, this can be reformulated as counting of subrepresentations of the maximal quiver representation of the associated oriented graph.

3.1.

Oriented graph associated with a rational. Given a rational r s = [a 1 , . . . , a 2m ], consider the simple graph A n-3 , where n = a 1 + • • • + a 2m + 2, with n -3 vertices written in a row and connected by n -2 single edges:

• • • • • • • •
This graph is of course known as the Dynkin diagram of type A n-3 .

Definition 3.1. Let us choose the orientation of the edges according to the following rules:

-first a 1 -1 edges oriented left -next a 2 edges oriented right -next a 3 edges oriented left, etc. -last a 2m -1 edges oriented right:

• o o a1-1 • • • • • o o • G G a2 • • • • • G G • o o a3 • • • • • o o • • • • • • • • G G a2m-1 • • • • • G G •
We denote by G r/s the constructed oriented graph.

Example 3.2. (a) The rationals 5 2 , 5 3 and 7 5 correspond to the graphs

• o o • G G • • G G • o o • • G G • G G • o o • respectively. (b) The rational 25 11 = [2, 3, 1, 2] has the graph • o o • G G • G G • G G • o o • G G •
We will also consider a shorter graph obtained from G r/s by removing the first a 1 arrows. It has the form:

• G G a2-1 • • • • • G G • o o a3 • • • • • o o • • • • • • • • G G a2m-1 • • • • • G G •
and will be denoted by G r/s .

Remark 3.3. The graph G r/s is just the standard graph that is usually associated to a triangulation. In our case, the triangulation T r/s is particularly simple, so that the corresponding graph is of type A.

Note that G r/s may be thought of as projectively dual1 to the triangulation T r/s in the following sense. Vertices of G r/s are identified with diagonals of T r/s , and its edges are identified with the vertices of T r/s where the diagonals cross:

• • • • o o • o o • G G • G G • • • • • • • • • • • • • • • • • • • • • • G G • G G • • • • • • • •
The projectively dual graph associated with a (more general) triangulation of an n-gon is constructed as follows. Mark a puncture at every diagonal of the triangulation, and join by an edge those punctures whose diagonals share a vertex of the n-gon. Fix the orientation of every edge of the graph in such a way that the orientation of the triangle defined by the edge and the corresponding vertex of the n-gon be positive. This leads to an oriented graph with n -3 vertices which is not necessarily bipartite and can contain cycles.

For example, the graph projectively dual to the following triangulated decagon

• r r • G G • • • h h • h h • • 7 7 W W • G G • o o • G G • o o • o o • contains a 3-cycle.
This is due to the interior triangle (yet the graph is "mutation equivalent" to A 7 in the sense of cluster algebra mutations). A closure with elements will be called an -vertex closure. A single vertex forms a 1-vertex closure if and only if it is a sink of G. More generally, an -vertex closure can be thought of as a "generalized sink". Note that there can be edges between the vertices that belong to the closure.

The following statement is our main combinatorial result.

Theorem 4. Let r s = [a 1 , . . . , a 2m ] and R(q) S(q) = r s q , then (i) the numerator is a polynomial R(q) = 1 + ρ 1 q + ρ 2 q 2 + • • • + ρ n-4 q n-4 + q n-3 , such that

ρ i = #{ i-vertex closures of the graph G r/s }, for all i;
(i) the denominator is a polynomial S(q) = 1 + σ 1 q + σ 2 q 2 + • • • + σ n-a1-4 q n-a1-4 + q n-a1-3 such that

σ i = #{ i-vertex closures of the graph G r/s }, for all i.
• o o • G G • one 0-closure • o o • G G • • o o • G G • two 1-closures • o o • G G • one 2-closure • o o • G G • one 3-closure
where the vertices forming a closure are colored black. The corresponding polynomial is 1 + 2q + q 2 + q 3 , the numerator of 5 2 q . (b) Similarly, the graph G 5/3 has:

• G G • o o • one 0-closure • G G • o o • one 1-closures • G G • o o • • G G • o o • two 2-closures • G G • o o • one 3-closure
The corresponding polynomial is 1 + q + 2q 2 + q 3 , the numerator of 5 3 q . (c) The graph G 25/11 (in which, for convenience, we number the vertices) is as follows

1 o o 2 G G 3 G G 4 G G 5 o o 6 G G 7
It obviously has one 0-closure, one 7-closure, and three 1-closures (three sinks, 1, 5 and 7). It furthermore has:

-four 2-closures, namely the "double sinks" (1, 5), (1, 7), (5, 7) and (4, 5); -five 3-closures (1, 5, 7), [START_REF] Andrews | q-series: their development and application in analysis, number theory, combinatorics, physics, and computer algebra[END_REF][START_REF] Boca | Products of matrices 1 1 0 1 and 1 0 1 1 and the distribution of reduced quadratic irrationals[END_REF][START_REF] Broline | The geometry of frieze patterns[END_REF], [START_REF] Berstel | Noncommutative rational series with applications[END_REF][START_REF] Boca | Products of matrices 1 1 0 1 and 1 0 1 1 and the distribution of reduced quadratic irrationals[END_REF][START_REF] Broline | The geometry of frieze patterns[END_REF], (4, 5, 7), (5, 6, 7); -five 4-closures [START_REF] Andrews | q-series: their development and application in analysis, number theory, combinatorics, physics, and computer algebra[END_REF][START_REF] Berstel | Noncommutative rational series with applications[END_REF][START_REF] Boca | Products of matrices 1 1 0 1 and 1 0 1 1 and the distribution of reduced quadratic irrationals[END_REF][START_REF] Broline | The geometry of frieze patterns[END_REF], [START_REF] Andrews | q-series: their development and application in analysis, number theory, combinatorics, physics, and computer algebra[END_REF][START_REF] Boca | Products of matrices 1 1 0 1 and 1 0 1 1 and the distribution of reduced quadratic irrationals[END_REF][START_REF] Broline | The geometry of frieze patterns[END_REF][START_REF] Canakci | Snake graphs and continued fractions[END_REF], [START_REF] Andrews | q-series: their development and application in analysis, number theory, combinatorics, physics, and computer algebra[END_REF][START_REF] Broline | The geometry of frieze patterns[END_REF][START_REF] Canakci | Snake graphs and continued fractions[END_REF][START_REF] Carlitz | Fibonacci notes. III. q-Fibonacci numbers[END_REF], [START_REF] Berstel | Noncommutative rational series with applications[END_REF][START_REF] Boca | Products of matrices 1 1 0 1 and 1 0 1 1 and the distribution of reduced quadratic irrationals[END_REF][START_REF] Broline | The geometry of frieze patterns[END_REF][START_REF] Carlitz | Fibonacci notes. III. q-Fibonacci numbers[END_REF] and (4, 5, 6, 7); -four 5-closures obtained by removing one of the pairs of points: (1, 2), (2, 3), [START_REF] Andrews | q-series: their development and application in analysis, number theory, combinatorics, physics, and computer algebra[END_REF][START_REF] Canakci | Snake graphs and continued fractions[END_REF], or (6, 7); -two 6-closures, obtained by removing one of the two sources 2 or 6. The polynomial R in the numerator of 25 11 q is indeed, R(q) = 1 + 3q + 4q 2 + 5q 3 + 5q 4 + 4q 5 + 2q 6 + q 7 . (d) The graph G 25/11 is as follows

1 G G 2 G G 3 o o 4 G G 5
It has:

-one 0-closure; -two 1-closures (the two sinks, 3 and 5); -two 2-closures, namely the "double sink" (3, 5) and (2, 3); -three 3-closures (1, 2, 3), [START_REF] Berstel | Noncommutative rational series with applications[END_REF][START_REF] Boca | Products of matrices 1 1 0 1 and 1 0 1 1 and the distribution of reduced quadratic irrationals[END_REF][START_REF] Broline | The geometry of frieze patterns[END_REF], (2, 3, 5); -two 4-closures (2, 3, 4, 5), (1, 2, 3, 5); -one 5-closure.

On can compute the polynomial S corresponding to 25 11 q and check that indeed,

S(q) = 1 + 2q + 2q 2 + 3q 3 + 2q 4 + q 5 .
Remark 3.6. (a) As a corollary of Theorem 4, we see that the total number of closure subsets of the graphs G r/s and G r/s is equal to r and s, respectively. This observation provides an interesting combinatorial way to calculate the numerator and denominator of a (classical) continued fraction. (b) It would be interesting to investigate counting of closure subsets of vertices and the corresponding polynomials for more general graphs than G r/s . For instance, applied to the case of the graph projectively dual to a triangulation (see Remark 3.3) this approach could lead to a version of quantized Grassmannian G 2,n .

3.3.

A reformulation with quiver representations. An equivalent reformulation of Theorem 4 uses the notion of quiver representations (a "quiver" being another word for an oriented graph). Let us recall a few standard definitions and facts. We refer to [START_REF] Derksen | An introduction to quiver representations[END_REF] for the general theory of quiver representations.

A representation of a quiver associates a vector space to each vertex, and a linear map to each edge. A representation is indecomposable if it is not isomorphic to the direct sum of non-zero representations. According to a theorem of Gabriel, indecomposable representations of a quiver of finite (i.e., of Dynkin) type correspond to the positive roots of the root system of the Dynkin diagram.

The graph G r/s is a quiver of Dynkin type A, it has one indecomposable representation of maximal dimension, where every vector space is one-dimensional and every linear map is the identity map:

C o o Id C • • • C o o Id C Id G G C • • • C Id G G C • • • • • • C Id G G C • • • C Id G G C
A subrepresentation of this representation replaces some of the spaces C by {0} in such a way that the identity maps remain consistent.

Proposition 3.7.

There is a one-to-one correspondence between subrepresentations of the above maximal representation and closure subsets.

This statement is obvious from the definition. Indeed, in this correspondence every vertex of a closure subset is assigned with C, and the vertices that do not belong to the closure with {0}.

As a consequence, we have the following.

Corollary 3.8. The coefficients of the polynomials R and S corresponding to a q-rational r s q count subrepresentations of the indecomposable representation of maximal dimension of G r/s and G r/s , respectively.

This reformulation of Theorem 4 is perhaps more conceptual and has more chances to be generalized within the framework of quiver representations.

Proof of Theorem 4. We use the induction on n

= a 1 + • • • + a 2m + 2.
The basis n = 4 is obvious: the graph G 2/1 consists in one point and has one empty and one 1-vertex closure, that corresponds to the polynomial R(q) = 1 + q, while the graph G 2/1 is empty and corresponds to the polynomial S(q) = 1.

Let us prove the induction step. Consider a rational r s = [a 1 , . . . , a 2m ]. Case A. Assume that a 2m ≥ 3, then the triangulation T r/s ends with (at least) three base-up triangles, and the corresponding graph G r/s has (at least) two last edges oriented to the right.

• • q R S q R S • • • • G G • G G • R S
By Definition 2.7, one has

(3.1) R = qR + R . Consider the rational r s = [a 1 , . . . , a 2m-1 , a 2m -1]
whose triangulation T r /s (resp. graph G r /s ) is obtained by removing one right triangle (resp. one right edge). In the case of the rational

r s = [a 1 , . . . , a 2m-1 -1, 1],
the triangulation T r /s is obtained by removing a 2m base-up triangles in the right and reversion of the last base-down triangle in the series of a 2m-1 base-down triangles. The graph G r /s is obtained by removing the last a 2m vertices. The three graphs can be drawn in the same picture.

G r /s G r /s G r/s • o o a1-1 • • • • • o o • G G a2 • • • • • G G • • • • • • • • o o a2m-1-1 • • • • • o o • o o • G G a2m-2 • • • • • G G • G G •
Let us compare the closure subsets of G r/s , G r /s and G r /s . Lemma 3.9. One has:

(3.2) ρ +1 = ρ + ρ +1 ,
where ρ +1 , ρ and r +1 are the numbers of ( + 1)-vertex closures of G r/s , of -vertex closures of G r /s , and ( + 1)-vertex closures of G r /s , respectively.

Proof. Every -vertex closure of G r /s corresponds to an ( + 1)-vertex closure of G r/s by adding the last right vertex of G r/s (which is a sink). Furthermore, every -vertex closure of G r /s corresponds to an -vertex closure of G r/s , that contains no vertex from the right a 2m -2 vertices. Hence the lemma.

By the induction assumption, the coefficients of the polynomials R (q) and R (q) count the closure subsets of the graphs G r /s and G r /s , respectively. Comparing formulas (3.1) and (3.2), we conclude that the similar property also holds for R(q).

The arguments in the case of the polynomial S(q) are similar. Theorem 4 is proved under the assumption a 2m ≥ 3.

Case B. Assume that a 2m = 2, then the triangulation T r/s and the graph G r/s end as follows

• R S q R S • • • • o o • G G • • R S
The proof is similar in this case and is again based on (3.1) and (3.2).

Case C. Assume that a 2m = 1, then the triangulation T r/s and the graph G r/s end as follows

R S q a 2m-1 +1 R S • • • • o o • o o • • • R S
so that R(q) = q a2m-1+1 R (q) + R . The graph G r /s is obtained from G r/s by removing a 2m-1 + 1 last vertices. Therefore, every -vertex closure of G r /s corresponds to ( + a 2m-1 + 1)-vertex closure of G r/s by adding these vertices back. On the other hand, an -vertex closure of G r /s corresponds to an -vertex closure of G r/s that does not contain the last vertex. We obtain, similarly to Lemma 3.2,

ρ = ρ -a2m-1-1 + ρ .
Theorem 4 is proved.

Matrices of continued fractions and their q-deformations

It is convenient to represent continued fractions via unimodular 2×2 matrices with integer coefficients. In this section, we develop a similar technique in the q-deformed case. This in particular allows us to prove Theorems 1, 2 and several other technical statements.

M + (a 1 , . . . , a 2m ) := a 1 1 1 0 a 2 1 1 0 • • • a 2m 1 1 0 , M (c 1 , . . . , c k ) := c 1 -1 1 0 c 2 -1 1 0 • • • c k -1 1 0 .
They are well-known as the matrices of convergents of the continued fractions for the following reason. One easily obtains:

M + (a 1 , . . . , a 2m ) = r r 2m-1 s s 2m-1 , M (c 1 , . . . , c k ) = r -r k-1 s -s k-1 ,
where

r 2m-1 s 2m-1 = [a 1 , . . . , a 2m-1 ], and r k-1 s k-1 = c 1 , . . . , c k-1 .
In terms of the elementary matrices

R = 1 1 0 1 , L = 1 0 1 1 , S = 0 -1 1 0 ,
(note that (R, S), or (L, S) is the standard choice of generators of the group SL(2, Z)) the above matrices are expressed as follows:

M + (a 1 , . . . , a 2m ) = R a1 L a2 R a3 L a4 • • • R a2m-1 L a2m , M (c 1 , . . . , c k ) = R c1 S R c2 S • • • R c k S.
Remark 4.1. Interest in the matrices M + (a 1 , . . . , a 2m ) and M (c 1 , . . . , c k ) exceeds the context of continued fractions; see, e.g., [START_REF] Zagier | Nombres de classes et fractions continues[END_REF][START_REF] Katok | Coding of closed geodesics after Gauss and Morse[END_REF][START_REF] Boca | Products of matrices 1 1 0 1 and 1 0 1 1 and the distribution of reduced quadratic irrationals[END_REF][START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF][START_REF] Morier-Genoud | Continued fractions and triangulations, modular group and polygon dissections[END_REF]. Indeed, they appear in the theory of linear difference equations, as the monodromy matrices. They play important roles in the theory of discrete integrable systems.

4.2. q-deformation of the matrices of convergents. We define q-deformations of the matrices of convergents M + (a 1 , . . . , a 2m ) and M (c 1 , . . . , c n ).

M q (c 1 , . . . , c k ) = [c 1 ] q -q c1-1 1 0 [c 2 ] q -q c2-1 1 0 • • • [c k ] q -q c k -1 1 0
is the q-analogue of the matrix M (c 1 , . . . , c k ).

(ii) The matrix

(4.2) M + q (a 1 , . . . , a 2m ) = [a 1 ] q q a1 1 0 [a 2 ] q -1 q -a2 1 0 • • • [a 2m-1 ] q q a2m-1 1 0 [a 2m ] q -1 q -a2m
1 0

is the q-analogue of the matrix M + (a 1 , a 2 , . . . , a 2m ).

Note that the entries of the matrix M + q (a 1 , a 2 , . . . , a 2m ) are polynomials in q ±1 . We also define the following normalized matrix in order to get entries that are polynomials in q: M + q (a 1 , . . . , a 2m ) := q a2+a4+...+a2m M + q (a 1 , . . . , a 2m ). The above definition is justified by the fact that the defined matrices are the matrices of convergents of the q-deformed continued fractions (1.2) and (1.1), respectively.

Proposition 4.3. (i) One has M q (c 1 , . . . , c k ) = R -q c k -1 R k-1 S -q c k -1 S k-1
, where R(q) S(q) = c 1 , . . . , c k q , R k-1 (q) S k-1 (q) = c 1 , . . . , c k-1 q . (ii) One has

M + q (a 1 , . . . , a 2m ) = qR R 2m-1 qS S 2m-1 where R(q) S(q) = [a 1 , . . . , a 2m ] q , R 2m-1 (q) S 2m-1 (q) = [a 1 , . . . , a 2m-1 ] q .
Proof. This statement is an immediate consequence of the linear recurrence relations for the convergents; cf. Section 1.3.

4.3. q-deformation of the generators. Let us introduce q-analogues of the matrices R, L and S.

Definition 4.4. The q-analogues of the matrices R, L and S are the following elements of GL(2, Z[q, q -1 ])

R q := q 1 0 1 , L q := 1 0 1 q -1 , S q := 0 -q -1 1 0 .
Proposition 4.5. One has

M + q (a 1 , . . . , a 2m ) = R a1 q L a2 q • • • R a2m-1 q L a2m q , (4.3) M q (c 1 , . . . , c k ) = R c1 q S q R c2 q S q • • • R c k q S q . (4.4)
Proof. One easily gets the following expressions for the iterates of R q and L q : R a q := q a [a] q 0 1 , L a q := 1 0

[a] q -1 q -a .

By direct computations one checks

R ai q L ai+1 q = q ai + [a i ] q [a i+1 ] q -1 q -ai+1 [a i ] q [a i+1 ] q -1 q -ai+1 = [a i ] q q ai 1 0 [a i+1 ] q -1 q -ai+1 1 0
.

Hence the formula for M + q (a 1 , . . . , a 2m ). Similarly, one easily checks

R ci q S q = [c i ] q -q ci-1 1 0
.

Hence the formula for M q (c 1 , . . . , c k ).

4.4.

Local surgery operations. We describe two useful "local surgery" operations. These are qanalogues of the operations used in [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF][START_REF] Morier-Genoud | Continued fractions and triangulations, modular group and polygon dissections[END_REF]. The first operation inserts 1 into the sequence (c 1 , c 2 , . . . , c n ), increasing the two neighboring entries by 1; the second operation breaks one entry, c i , replacing it by c i , c i ∈ Z >0 such that c i + c i = c i + 1, and inserts two consecutive 1's between them.

Lemma 4.6. The matrix M q (c 1 , . . . , c n ) has the following identities:

M q (c 1 , . . . , c i + 1, 1, c i+1 + 1, . . . , c n ) = q M q (c 1 , . . . , c i , c i+1 , . . . , c n ), (4.5) M q (c 1 , . . . , c i , 1, 1, c i , . . . , c n ) = -M q (c 1 , . . . , c i , . . . , c n ), (4.6)
where c i + c i = c i + 1.
Proof. Formula (4.5) follows from the following simple computation:

[c + 1] q -q c 1 0 1 -1 1 0 [d + 1] q -q d 1 0 = q [c] q -q c-1 1 0 [d] q -q d-1 1 0 .
To prove (4.6), consider the product of matrices

[c + 1] q -q c 1 0 0 -1 1 -1 [c + 1] q -q c 1 0 = q c -[c + 1] q -q c [c + 1] q q c +c -1 0 and observe that q c -[c + 1] q -q c [c + 1] q = -[c + c + 1] q .
Remark 4.7. The operation (4.6) and the corresponding computation is a variation on the following analogue of the "sum of q-integers":

[a] q + q [b] q := [a] q + q a [b] q = q b [a] q + [b] q = [a + b] q ,
sometimes used in the q-differential calculus.

4.5. Solving the equation M q (c 1 , . . . , c n ) = ±q Id. The theorem of Conway and Coxeter [START_REF] Conway | Triangulated polygons and frieze patterns[END_REF] and its generalization [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF] classify positive integer solutions of the equation M (c 1 , . . . , c n ) = ±Id. They are formulated in terms of dissections of a convex n-gon. We give a q-analogue of these theorems. We believe that Lemma 4.6 may have an independent interest. Here we use it in order to solve the equation M q (c 1 , . . . , c n ) = ±q Id, where c i are positive integers.

Consider a convex n-gon and its dissection by non-crossing diagonals. A class of dissections, such that the number of vertices of every sub-polygon is a multiple of 3 was considered in [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF] and called "3ddissections". Following [START_REF] Conway | Triangulated polygons and frieze patterns[END_REF], call a "quiddity" of a dissection the sequence of positive integers, (c 1 , . . . , c n ), such that every c i is the number of sub-polygons incident with the i-th vertex. (i) If (c 1 , . . . , c n ) is the quiddity sequence of a triangulated n-gon then M q (c 1 , . . . , c n ) = -q n-3 Id .

(ii) The equality M q (c 1 , . . . , c n ) = ±q n-3 Id holds if and only if (c 1 , . . . , c n ) is the quiddity sequence of a 3d-dissected n-gon.

The proof of this statement is similar to the proof of Theorem 1 of [START_REF] Ovsienko | Partitions of unity in SL(2, Z), negative continued fractions, and dissections of polygons[END_REF], using the relations of Lemma 4.6. 4.6. Proof of Theorem 1. Our proof of Theorem 1 is a direct computation with the matrices of convergents.

Proposition 4.9. If r s = [a 1 , . . . , a 2m ] = c 1 , . . . , c k , then the q-deformed matrices of the continued fractions satisfy M + q (a 1 , . . . , a 2m ) = M q (c 1 , . . . , c k )R q . Proof. Suppose that r s = [a 1 , . . . , a 2m ] = c 1 , . . . , c k and use the conversion formula (2.1). One has

M q (c 1 , . . . , c k )R q = M q a 1 + 1, 2, . . . , 2 a2-1 , a 3 + 2, 2, . . . , 2 a4-1 , . . . , a 2m-1 + 2, 2, . . . , 2 a2m-1
This can be rewritten using Proposition 4.5 and changing the parentheses as

M q (c 1 , . . . , c k )R q = R a1+1 q S q R 2 q S q a2-1 R a3+2 q S q R 2 q S q a4-1 • • • R a2m-1+2 q S q R 2 q S q a2m-1 R q = R a1 q (R q S q R q ) a2 R a3 q (R q S q R q ) a4 • • • R a2m-1 q (R q S q R q ) a2m .
One then checks by a direct computation that R q S q R q = qL q , and therefore (R q S q R q ) a = q a L a q . This yields M q (c 1 , . . . , c k )R q = q a2+a4+...+a2m R a1 q L a2 q R a3 q L a4 q • • • R a2m-1 q L a2m q = q a2+a4+...+a2m M + q (a 1 , . . . , a 2m ) = M + q (a 1 , . . . , a 2m ). Proposition 4.9 is proved.

Theorem 1 readily follows from Proposition 4.9 and Proposition 4.3. 3 is given up to a power of q by the numerator of 2, 4, 3 q .

The vertices of the N -gon are numbered in decreasing order (the first vertex is 1 0 and N th vertex is 0 1 ). Let k and be the numbers of the vertices corresponding to the fractions R S and R S , respectively. We assume that > k + 1 (if = k + 1 the fractions are linked in the Farey graph and this case is covered separetely with Corollary 1.4 and Proposition 4.11 below).

Let (c 1 , . . . , c N ) be the quiddity of T r s , r s , i.e., c i is the number of triangles incident with the i-th vertex. By definition of T r s , r s , one has

c k = c = c N = 1,
and

c i ≥ 2 for i = k, , N.
Denote by R k, the numerator of the q-rational defined as:

R k, S k, := c k+1 , . . . , c -1 q .
The main ingredient of our proof is the following. This corresponds to removing one after the other exterior triangles in T r s , r s in order to obtain the triangulation T r s . We now use 2 × 2-matrix computations. (When an entry in the matrix is not relevant for the computation we replace it by a "star" symbol.) By Proposition 4.3 and formula (4.5), one has

R * S * = M q (c 1 , . . . , c k-1 ) and R * S * = M q (c 1 , . . . , c k ) = q -c M q (c 1 , . . . , c k-1 , 1, c k+1 , . . . , c -1 ),
where c is the number of local transformations applied on the sequence (c 1 , . . . , c -1 ) (i.e. the number of triangles removed from T r s , r s to obtain T r s

). Thus, one has

R * S * = q -c R * S * 1 -1 1 0 M q (c k+1 , . . . , c -1 ).
Now, in the above matrix equation multiplying on the left by

R * S * 1 -1 1 0 -1 = * -R * -S -1 = q -c -S R * *
, where q c is the determinant of M q (c 1 , . . . , c k-1 ), gives X r s , r s * * * = q c M q (c k+1 , . . . , c -1 ).

Hence the result, according to Proposition 4.3.

By Proposition 1.3, R k, is a polynomial with positive coefficient. Lemma 4.10 then implies that X r s , r s is a polynomial with positive integer coefficients. Theorem 2 is proved.

4.8. The weight of two neighbours. The exact value for the power of q in the case where the fractions are connected by an edge in the Farey graph (i.e., the value of α in Corollary 1.4) can be computed explicitly using the coefficients of the expansions of the continued fractions and is given in the following proposition.

Proposition 4.11. Let R S and R S be two q-rationals, corresponding to the rationals r s = c 1 , . . . , c k-1 and r s = c 1 , . . . , c k , respectively. If r s and r s are linked in the Farey graph, and r s < r s , then

RS -SR = q c1+...+c k -k , if r > r , q c 1 +...+c k -1 -k +1 , if r > r.
Proof. Let the fractions r s and r s be linked in the Farey graph. In the case where r > r , the edge between the two fractions forms a left side of a triangle, and the two fractions belong to T r/s . In the weighted Farey graph T q r/s the local picture is:

1 q c k -1 q c k -2 R ′ S ′ R S R ′′ S ′′
One has by Proposition 4.3

M q (c 1 , . . . , c k ) = R -q c k -1 R S -q c k -1 S
.

Taking the determinants of the above matrices, one obtains

det M q (c 1 , . . . , c k ) = q c k -1 (R S -RS ) = q c1+•••+c k -k .
On the other hand, according to the weighted Farey sum (2.4), one has

R = R -q c k -1 R and S = S -q c k -1 S .
So that we deduce

RS -R S = q c1+•••+c k -k .
In the case where r > r, the edge between the two fractions forms a right side of a triangle, and the two fractions belong to T q r s . The local picture is:

1 q c ′ k ′ -1 q c ′ k ′ -2 R ′′ S ′′ R ′ S ′ R S
Computing the determinant of the matrix 1) . Hence the result.

M q (c 1 , . . . , c k ) = R -q c k -1 R S -q c k -1 S , one gets RS -R S = q c 1 +•••+c k -1 -(k -
4.9. Proof of Proposition 1.8. In the special case where q = -1, the matrices R q , L q and S q are as follows

R -1 = -1 1 0 1 , L -1 = 1 0 1 -1 . S -1 := 0 1 1 0 . Therefore, R 2 -1 = L 2 -1 = S 2 -1 =
Id and (R -1 S -1 ) 3 = Id. Formula (4.4) then implies that the matrix M -1 (c 1 , . . . , c k ) is equal to either one of the matrices

Id, R -1 , S -1 , R -1 S -1 , (R -1 S -1 ) 2 .
Each of these matrices has coefficients -1, 0, or 1. By Proposition 4.3, the numerator R(-1) of a q-rational equals the upper left coefficient of M -1 (c 1 , . . . , c k ). Hence Proposition 1.8, Part (i).

To prove Part (ii) we proceed by induction on the depth of the Farey graph. Every q-rational R S = r s q is obtained as the weighted Farey sum:

R S = R S ⊕ q R S .
In particular, R = R + q R . Let r , r be the nmerators of the corresponding rationals. By induction assumption, we have: (a) R (-1) = ±1 and R (-1) = ±1 if and only if r and r are odd.

(b) R (-1) = 0 and R (-1) = 0 if and only if r and r are even. The integer r is even if and only if r , r are either both odd, or both even. In view of Part (i), this implies that R(-1) = 0 if and only if r is even. And similarly for S.

Proposition 1.8 is proved.

q-analogues of the continuants

Continued fractions are related to the polynomials called the continuants. These polynomials express the numerator and denominator of a continued fraction r s = [a 1 , . . . , a 2m ] = c 1 , . . . , c k in terms of the coefficients a i and c i . They are calculated as determinants of certain tridiagonal matrices.

In this section we describe the q-continuants that provide similar formulas for calculating the numerator and denominator of a q-continued fractions. We prove a q-analogue of the Euler identity for the continuants.

5.1. Euler's continuants. Consider the tridiagonal determinants

K k (c 1 , . . . , c k ) := det          c 1 1 1 c 2 1 . . . . . . . . . 1 c k-1 1 1 c k         
where the empty space of the matrix is filled by zero entries, and

K + 2m (a 1 , . . . , a 2m ) := det           a 1 1 -1 a 2 1 . . . . . . . . . -1 a 2m-1 1 -1 a 2m          
.

One then has:

r = K + 2m (a 1 , . . . , a 2m ) = K k (c 1 , . . . , c k ), s = K + 2m-1 (a 2 , . . . , a 2m ) = K k-1 (c 2 , . . . , c k ). The polynomials K k (c 1 , . . . , c k ) and K + 2m (a 1 , .
. . , a 2m ) are usually called the continuants; see [START_REF] Berstel | Noncommutative rational series with applications[END_REF][START_REF] Graham | Concrete mathematics. A foundation for computer science[END_REF]. They were studied by Euler who proved a series of identities involving them. The identities found by Euler are as follows

K k-i-1 (c i+1 , . . . , c k-1 ) K -j-1 (c j+1 , . . . , c -1 ) = K j-i-1 (c i+1 , . . . , c j-1 ) K -k-1 (c k+1 , . . . , c -1 ) + K i--1 (c i+1 , . . . , c -1 ) K k-j-1 (c j+1 , . . . , c k-1 ). provided 1 ≤ i < j < k < ≤ n.
Remark 5.1. The above identity can also be called the "Euler-Ptolemy-Plücker relation" since it is a particular case of a general class of relations unified by the Plücker relations for the coordinates of the Grassmannian Gr 2,N (for more details; see [START_REF] Morier-Genoud | Continued fractions and triangulations, modular group and polygon dissections[END_REF] and references therein).

5.2.

Introducing q-deformed continuants. We call q-continuants the following determinants (5.1)

K k (c 1 , . . . , c k ) q := [c 1 ] q q c1-1 1 [c 2 ] q q c2-1 . . . . . . . . . 1 [c k-1 ] q q c k-1 -1 1 [c k ] q , and (5.2)
K + 2m (a 1 , . . . , a 2m ) q := [a 1 ] q q a1 -1 [a 2 ] q -1 q -a2 -1 [a 3 ] q q a3 -1 [a 4 ] q -1 q -a4 . . . . . . . . . -1 [a 2m-1 ] q q a2m-1 -1 [a 2m ] q -1
, where c i and a i are positive integers. We will need to consider also the continuant K + over an odd number of variables. We denote

K + 2m-1 (a 2 , . . . , a 2m ) q := [a 2 ] q -1 q -a2 -1 [a 3 ] q q a3 -1 [a 4 ] q -1 q -a4 . . . . . . . . . -1 [a 2m-1 ] q q a2m-1 -1 [a 2m ] q -1
.

One easily gets by induction the following realtions between the q-continuants and the matrices of convergents M q and M + q . Proposition 5.2. (i) Let (c 1 , . . . , c k ) be positive integers. One has

M q (c 1 , . . . , c k ) = K k (c 1 , . . . , c k ) q -q c k -1 K k-1 (c 1 , . . . , c k-1 ) q K k-1 (c 2 , . . . , c k ) q -q c k -1 K k-2 (c 2 , . . . , c k-1 ) q .
(ii) Let (a 1 , . . . , a 2m ) be positive integers. One has

M + q (a 1 , . . . , a 2m ) = K + 2m (a 1 , . . . , a 2m ) q q a2m K + 2m-1 (a 1 , . . . , a 2m-1 ) q -1 K + 2m-1 (a 2 , . . . , a 2m ) q q a2m K + 2m-2 (a 2 , . . . , a 2m-1 ) q -1 .
Combining the above proposition with Proposition 4.9, one gets the following formulas for the numerators and denominators of q-rationals. Proposition 5.3. If r s q = [a 1 , . . . , a 2m ] q = c 1 , . . . , c k q = R(q) S(q) , then R(q) = K k (c 1 , . . . , c k ) q = q a2+a4+...+a2m-1 K + 2m (a 1 , . . . , a 2m ) q , S(q) = K k-1 (c 2 , . . . , c k ) q = q a2+a4+...+a2m-1 K + 2m-1 (a 2 , . . . , a 2m ) q . (Note that k = a 2 + a 4 + . . . + a 2m .) Remark 5.4. (i) Computing M q (c 1 , . . . , c k ) -1 one easily obtains the "mirror formula":

K k (c 1 , . . . , c k ) q = q c1+...+c k -k K k (c k , . . . , c 1 ) q -1 .
(ii) By Corollary 4.8, if (c 1 , . . . , c n ) is the quiddity sequence of a triangulated n-gon one has

K k (c 1 , . . . , c k ) q = K n-k-2 (c k+2 , . . . , c n ) q .
5.3. Euler's identities for the q-deformed continuants. We give an analogue of Euler's identity for the q-continuants.

Fix a sequence of integers (c i ) 1≤i≤n and denote by K q i,j the continuant of order j -i -1 generated by the segment between c i+1 and c j-1 :

K q i,j := K j-i-1 (c i+1 , .
. . , c j-1 ) q , with the convention K q i,i = 0 and K q i,i+1 = 1. Proposition 5.5. The sequence (K q i,j ) 1≤i≤j≤n satisfies the relation:

(5.3) K q i,k K q j,l = q cj +...+c k-1 -(k-j) K q i,j K q k,l + K q j,k K q i,l provided 1 ≤ i < j < k < ≤ n.
Proof. We consider a 2 × n matrix whose first row is given by (R i ) 1≤i≤n and second row by (S i ) 1≤i≤n where R i := K i-1 (c 1 , . . . , c i-1 ) q , S i := K i-2 (c 2 , . . . , c i-1 ) q . The 2 × 2-minors of this matrix ∆ i,j := R i S j -R j S i , satisfy the Plücker-Ptolemy relations

(5.4) ∆ i,k ∆ j,l = ∆ i,j ∆ k,l + ∆ j,k ∆ i,l
provided 1 < i < j < k < ≤ n. We now express these minors in terms of q-continuants to obtain the desired indentity. We use 2 × 2-matrix computations. When an entry in the matrix is not relevant for the computation we replace it by a 'star' symbol. By Proposition 4.3 one has

R j * S j * = M q (c 1 , . . . , c j-1 ) = M q (c 1 , . . . , c i-1 )M q (c i , . . . , c j-1 ).
We multiply the above matrix equation on the left by

M q (c i , . . . , c i-1 ) -1 = R i * S i * -1 = q -(c1+...+ci-1-(i-1)) * * -S i R i
and obtain, according to Proposition 5.2 * * ∆ i,j * = q c1+...+ci-1-(i-1) M q (c i , . . . , c j-1 ) = q c1+...+ci-1-(i-1) * * K q i,j * Rewriting (5.4) using ∆ i,j = q c1+...+ci-1-(i-1) K q i,j gives (5.3).

6.

Two examples of infinite sequences: q-Fibonacci and q-Pell numbers

In this section we consider q-analogues of two examples of infinite sequences of rationals.

A The sequence of convergents of the simplest infinite continued fraction representing the golden ratio

1+ √ 5 2 = [1, 1, 1, 1, . . .].
More precisely, we have rn sn = Fn+1 Fn , where F n is the n th Fibonacci number. B The sequence of convergents of the continued fraction 1 + √ 2 = [2, 2, 2, 2, . . .] called the "silver ratio". These are the ratios of consecutive Pell numbers: rn sn = Pn+1 Pn (recall that the sequence (P n ) n≥0 = (0, 1, 2, 5, 12, 29, 70, 169, 408, . . .) is A000129 of OEIS).

We calculate the q-deformations of these two sequences, according to our Definition 1.1, and this leads to q-deformations of Fibonacci and Pell numbers. It turns out that the q-deformation of the Fibonacci numbers standing in the denominator is the well-known Sequence A079487, while the q-deformation of the Fibonacci numbers in the numerator is the "mirror" Sequence A123245 of OEIS . Surprisingly, the q-deformation of the Pell numbers appears to be a new version.

Let us mention that q-deformations of Fibonacci and Pell numbers is an active subject related to several branches of combinatorics and number theory (see, e.g., [START_REF] Carlitz | Fibonacci notes. III. q-Fibonacci numbers[END_REF][START_REF] Andrews | Eight-vertex SOS model and generalized Rogers-Ramanujan-type identities[END_REF][START_REF] Andrews | q-series: their development and application in analysis, number theory, combinatorics, physics, and computer algebra[END_REF][START_REF] Pan | Arithmetic properties of q-Fibonacci numbers and q-Pell numbers[END_REF] and references therein).

6.1. Sequence A079487 and its mirror A123245. Consider the infinite triangle of positive integers (f i,j ) i,j≥2 , with the initial conditions f 2,0 = f 3,0 = f 3,1 = 1 and the convention f i,j = 0, for j < 0, and defined by the recurrence relation (6.1)

f 2i+1,j = f 2i,j-1 + f 2i-1,j , f 2i+2,j = f 2i+1,j + f 2i,j-2 ,
for i ≥ 1. Sequence A079487 is known under the name of the second kind of Whitney numbers of Fibonacci lattices. The sum of the numbers in i th row is equal to the Fibonacci number F i+1 . Sequence A123245 is the mirror of A079487, i.e., this is the triangle A079487 with reversed rows. Using the notation fi,j i,j≥0

, the recurrence for A123245 is the same as of (6.1) with the parity exchanged: (6.2) f2i+2,j = f2i+1,j-1 + f2i,j , f2i+1,j = f2i,j + f2i-1,j-2 , for i ≥ 1.

The triangles A079487 and A123245 start as follows F n+1 (q) := 0≤i≤n f n,i q i and Fn+1 (q) := 0≤i≤n fn,i q i . This recurrences (6.1) and (6.2) then read (6.4)

F 2 +1 = qF 2 + F 2 -1 , F 2 +2 = F 2 +1 + q 2 F 2 , F2 +1 = F2 + q 2 F2 -1 , F2 +2 = q F2 +1 + F2 ,
for ≥ 1, respectively. The numbers f i,j and fi,j have many interesting combinatorial interpretations [START_REF] Munarini | On the rank polynomial of the lattice of order ideals of fences and crowns[END_REF] (for a nice survey; see [START_REF] Khrabrov | Points on a line, shoelace and dominoes[END_REF]). In particular, the numbers f 2i,j = f2i,j are related to the following graph (6.5) •

$ $ Ö Ö • Ö Ö $ $ • Ö Ö $ $ • Ö Ö $ $ • • • • $ $ Ö Ö • Ö Ö • • • • • • • •
with 2i -2 vertices, called the "fence". More precisely, the number f 2i,j is equal to the number of j-point closures (cf. Definition 3.4) of this graph. Similarly, the number f2i+1,j is equal to the number of j-point closures of the graph (6.6)

• $ $ • Ö Ö $ $ • Ö Ö $ $ • Ö Ö $ $ • • • • $ $ Ö Ö • Ö Ö • • • • • • • with 2i -1 vertices.
Finally, the numbers f 2i+1,j count j-point closures of the same graph but with reversed orientation.

6.2. Quantization of the ratio of Fibonacci numbers. It turns out that the polynomials arising from the q-deformations of the sequence Fn+1 Fn coincide with the polynomials (6.3). More precisely, one has the following. Proposition 6.1. One has Fn+1 Fn q = Fn+1(q) Fn(q) .

Proof. The triangulation corresponding to the continued fraction [1, 1, 1, 1, . . .] is

• q • q 2 q • q 2 q • • q 2 q • • • • • • • • • • • • •
cf. Sections 2.1 and 2.3. (Note that we mark only those diagonals that have weights different from 1.)

Therefore, the polynomials in the numerator and denominator of Fn+1

Fn q satisfy the recurrence (6.4).

Remark 6.2. The graph G rn/sn is (6.6). It was proved in [START_REF] Munarini | On the rank polynomial of the lattice of order ideals of fences and crowns[END_REF], that the coefficients of the polynomials F n (q) count its closures. Theorem 4 is a generalization of this result.

6.3.

A q-deformation of the Pell numbers. The q-continued fraction [2, 2, 2, 2, . . .] q corresponds to the triangulation

• q 2 q • q • q q 2 q 3 • q • • q 2 q 3 • q • • • • • • • • • • • • • •
where the black vertices correspond to the convergents of the continued fraction.

consecutive coefficients) and then monotonously decrease to 1. We are convinced that the polynomials R and S have this property for an arbitrary q-rational.

Let us mention that the unimodality property can be an indication of relationship of q-rationals to other theories where a similar phenomenon occurs, such as cohomology of symplectic varieties, associated with quivers.

Factorization. Given a rational r s , we conjecture that, in the case where r = r 1 r 2 , the polynomial R of the q-rational R(q) S(q) = r s q also factorizes: R = R 1 R 2 , where R 1 (1) = r 1 and R 2 (1) = r 2 . It would be nice to understand the properties of the polynomials R 1 and R 2 .

We proved (Proposition 1.8) that, if r is even, then R(q) is a multiple of (1 + q). If r is a multiple of 3, we conjecture that R(q) is a multiple of (1 + q + q 2 ). For instance, the example 9 7 q = (1 + q + q 2 )(1 + q 2 + q 3 ) 1 + q + 2q 2 + 2q 3 + q 4 is amusing, since 3 is quantized twice in this example, as (1 + q + q 2 ) and as (1 + q 2 + q 3 ).

Starting from 5 the situation changes. If r is a multiple of 5, then the polynomial R can be a multiple of (1 + q + q 2 + q 3 + q 4 ), (1 + 2q + q 2 + q 3 ), or (1 + q + 2q 2 + q 3 ), as we have already observed in Section 1, but 5 can also quantize in many different ways, for example 15 7 q = (1 + q + q 2 )(1 + q + q 3 + q 4 + q 6 ) 1 + q + q 2 + q 3 + q 4 + q 5 + q 6 , 15 8 q = (1 + q + q 2 )(1 + q 2 + q 3 + q 5 + q 6 ) (1 + q)(1 + q 2 )(1 + q 4 ) .

We also believe that the denominator S has similar properties.

Enumeration questions. It is a challenging problem to find more different combinatorial and geometric interpretations of the polynomials R and S, besides Theorem 4.

A natural question is to connect the polynomials R and S with counting of points in varieties defined over the finite fields F q . This property would be similar to that of Gaussian q-binomial coefficients.

For every rational r s , there exist a combinatorial interpretation of r and s in terms of the number of perfect matchings of so-called "snake graphs"; see [START_REF] Canakci | Snake graphs and continued fractions[END_REF]. Note that this counting is closely related with that of [START_REF] Broline | The geometry of frieze patterns[END_REF]. (Recall that the entries of a Coxeter frieze pattern [START_REF] Coxeter | Frieze patterns[END_REF] are precisely the numerator/denominator of the negative continued fraction with the coefficients in the second row of the frieze.)

Let us also mention that in one of the examples considered in Section 6 several combinatorial interpretations are available. The sequence A079487 has a number of different combinatorial interpretations including some particular Motzkin paths and combinations of binomial coefficients; cf. [START_REF] Khrabrov | Points on a line, shoelace and dominoes[END_REF]. This sequence is also related to binary words, cf. A078807 and to perfect matching (or "dominoes"; see [START_REF] Khrabrov | Points on a line, shoelace and dominoes[END_REF]).

Appendix A. Jones polynomial and q-continued fractions As an application of the developed notion of q-rational numbers, we relate this notion with the Jones polynomials of rational knots. This particular class of knots are parametrized by rational numbers, see e.g. [START_REF] Kauffman | On the classification of rational knots[END_REF]. It turns out that the Jones polynomial of the knot parametrized by the rational r s can be computed from the polynomials R and S of the q-rational r s + 1 q .

Recently, the Jones polynomial was computed using the combinatorics of snake graphs and cluster algebras [START_REF] Lee | Cluster algebras and Jones polynomials[END_REF], and in the the Kauffman bracket form it was computed from the combinatorics of Stern-Brocot tree [START_REF] Kogiso | A Bridge between Conway-Coxeter Friezes and Rational Tangles through the Kauffman Bracket Polynomials[END_REF]. The combinatorics used in these papers is closely related to that of continued fractions, extensively used in the present paper.

The formula given in [22, Thm 1.2 (b)] involves a certain q-continued fraction. It can be easily rewritten under the form (1.1). With this observation, we reformulate the result of [START_REF] Lee | Cluster algebras and Jones polynomials[END_REF] in terms of q-rationals and q-continuants.

A.1. Jones polynomial and q-rationals. We denote by C( r s ) the class of rational knots parametrized by the rational r s > 1. The Jones polynomial of C( r s ) is denoted by

V r s ∈ t 1 2 Z[t, t -1 ] ∪ Z[t, t -1 ]
We describe below a polynomial J r s (q) ∈ Z >0 [q] satisfying V r s (t) =: ±t p J r s (-t -1 ). where t p is the leading term of V r s (i.e. the term with greatest positive power). The 'normalized Jones polynomial' J r s (q) is given by the q-rational r+s s q . More precisely one has the following statement, which will be obtained in the next section as a corollary of Proposition A.2.

Proposition A.1. For every rational r s , the Jones polynomial of C( r s ) is J r s (q) = R(q) -qS(q). where R(q) S(q) := r+s s q . A.2. Jones polynomial and q-continuants. Using the expansion as regular or negative continued fraction one obtains the following explicit formulas in terms of the q-continuants of Section 5.2.

Proposition A.2. (i) Let c 1 , . . . , c k be the expansion as negative continued fraction of r s > 1. The Jones polynomial J r s (q) is given by J

r s (q) = K k (c 1 + 1, . . . , c k ) q -qK k-1 (c 2 , . . . , c k ) q (A.1) = -q + [c 1 + 1] q q c1 1 [c 2 ] q q c2-1 . . . . . . . . . 1 [c k-1 ] q q c k-1 -1 1 [c k ] q . (A.2)
(ii) Let [a 1 , . . . , a 2m ] be the expansion as regular continued fraction of r s > 1. The Jones polynomial J r s (q) is given by J r s (q) = K + 2m (a 1 , . . . , a 2m ) q -qK + 2m-1 (a 2 , . . . , a 2m ) q (A.3) = q a2+a4+...+a2m-1

-q + [a 1 + 1] q q a1+1 -1 [a 2 ] q -1 q -a2 -1 [a 3 ] q q a3 -1 [a 4 ] q -1 q -a4 . . . . . . . . . -1 [a 2m-1 ] q q a2m-1 -1 [a 2m ] q -1 . (A.4)
Proof. Theorem 1.2 in [START_REF] Lee | Cluster algebras and Jones polynomials[END_REF] says that the Jones polynomial J r s (q) can be computed as the numerator of a continued fraction. In terms of the continuant the formula is

J r s (q) = q 2m det(M )
where

M =                 -q + [a 1 + 1] q 1 -1 [a 2 ] q q -2 1 -1 [a 3 ] q q 2 +1 1 -1 [a 4 ] q q -4 1 . . . . . . . . . -1 [a 2m-1 ] q q 2m+1 1 -1 [a 2m ] q q -2m                
.

and i = a 1 + a 2 + . . . + a i .
It is easy to see that this determinant is the same as the one appearing in Eq. (A.4). Indeed, one can rescale the rows of M by multiplying M on the left by the diagonal matrix a1+1) , q a2 , . . . , q -(a1+a3+...+a2j-1+1) , q a2+a4+...+a2j , . . . , q -(a2+a4+...+a2m-2) ), and rescale the columns by multiplying M on the left by the diagonal matrix D 2 = diag(1, q a1+1 , q -a2 , . . . , q a1+a3+...+a2j-1+1 , q -(a2+a4+...+a2j ) , . . . , q a1+a3+...+a2m-1+1 ).

D 1 = diag(1, 1, q -(
One concludes that q 2m det(M ) is the determinant appearing in formula (A.4).

Comparing with Proposition 5.3 we deduce that J r s (q) is the numerator of the fraction [a 1 , . . . , a 2m ] q -q = c 1 + 1, . . . , c k -q. This implies (A.1), (A.2) and Proposition A.1.

A.3. Jones polynomial and counting on graphs. Applying the result of Section 3, we deduce the following interpretation of the coefficients of the Jones polynomial.

Proposition A.3. Let [a 1 , . . . , a 2m ] be the expansion as regular continued fraction of r s > 1. Denote by J r s (q) = γ 0 + γ 1 q + . . . + γ d q d the corresponding Jones polynomial where d = a 1 + . . . + a 2m . For all 0 ≤ ≤ d, γ is the number of -closures of the graph

1 o o a1 2 • • • • o o • G G a2 • • • • • G G • o o a3 • • • • • o o • • • • • • • • G G a2m-1 • • • • d -1 G G d
for which the pair of vertices (1, 2) is either in the closure or in its complement.

A. The Jones polynomial is

V 15/4 (t) = -t 8 (1 -t -1 + 2t -2 -3t -3 + 2t -4 -3t -5 + 2t -6 -t -7 ).
One can compute J 15/4 (q) = [5] q q 4 1 [4] q -q[4] q = 1 + q + 2q 2 + 3q 3 + 2q 4 + 3q

(b) Consider the link L5a1 from Thistlethwaite Link Table (see katlas.org). This link is parametrized by 8 3 = [2, 1, 1, 1] = 3, 3 . It can be represented with the following diagram:

The Jones polynomial is

V 8/3 (t) = -t 3/2 (1 -t -1 + 2t -2 -t -3 + 2t -4 -t -5 ). One can compute J 8/3 (q) = [4] q q 3 1 [3] q -q[3] q = 1 + q + 2q 2 + q 3 + 2q 4 + q 5 .
One immediately checks V 8/3 (t) = -t 3/2 J 8/3 (-t -1 ).

The coefficients can be recovered by counting the closures that do not isolate the first vertex of the following graph

q n-3 x 0,k+1 = [c 1 ] q q c1-1 1 [c 2 ] q q c2-1 . . . . . . . . . 1 [c k-1 ] q q c k-1 -1 1 [c k ] q = R, q n-3 x 1,k+1 = [c 2 ] q q c2-1 1 . . . . . . . . . [c k-1 ] q q c k-1 -1 1 [c k ] q = S.
In particular, x 0,k+1 x 1,k+1 = r s q and x 0,k+1 = K k (c 1 , . . . , c 1 ) q -1 .

Proof. This can be established by elementary computations using the Ptolemy relations. We do the computations in two steps using the following lemmas.

Lemma B.2. For a system (x i,j ) satisfying (B.1) one has (B.3) x i-1,j+1 = 1 x i,i+1 x i+1,i+2 • • • x j-1,j

x i-1,i+1 x i+1,i+2

x i-1,i

x i,i+2

x i+2,i+3

. . . . . .

x j-3,j-2 x j-2,j x j,j+1

x j-2,j-1 x j-1,j+1

Proof. This is checked by an easy induction.

We first use this formula in order to compute x i-1,i+1

Lemma B.3. For the following triangulation of a (c + 2)-gon 0

q -β 1 c + 1 1 1 1 q -(β+c-1) 1 1 c 1 q β+1 2 q β+2 3 • • • c -2 q β+c-2 c -1 1
one has x 0,c = [c] q q -(β+c-1) .

Proof. Applying the Ptolemy relations in quadrilaterals with vertices i, i + 1, i + 2, c + 1, one gets x 0,2 = 1 + q, x i,i+2 = q β+i (1 + q), 0 < i < c -2, x c-2,c = 1 + q -1 .

One then has x i,i+1 = q β+i for 1 ≤ i < c -2, and can write x i+1,i+2 x i,i+1 = q, x i,i+2

x i,i+1 = 1 + q = [START_REF] Andrews | Eight-vertex SOS model and generalized Rogers-Ramanujan-type identities[END_REF] q .

We use this information to compute x 0,c with Eq. (B.3). We first rescale the columns, except the first and last, by dividing by x i,i+1 . We obtain x 0,c = 1 x c-2,c-1

x 0,2 q

x 0,1 [START_REF] Andrews | Eight-vertex SOS model and generalized Rogers-Ramanujan-type identities[END_REF] q q 1 [2] q q . . . . . . . . .

1 [2] q x c-1,c
1 x c-2,c = 1 q β+c-1

[2] q q 1 [2] q q 1 [2] q q . . . . . . . . .

[2]

q q 1 1 + q One easily checks that K c-1 (2, 2, . . . , 2) q = [c] q . So that we deduce x 0,c = [c] q q -(β+c-1) .

Going back to the assigment of Figure 3, by Lemma B.3 one gets

x i-1,i+1 = q -(c1+...+ci-i) [c i ] q for all 1 ≤ i ≤ k. So that xi-1,i+1

xi-1,i = [c i ] q . One then computes x 0,k+1 and x 1,k+1 using (B.3), and obtains the desired formulas. The final formula x 0,k+1 = K k (c 1 , . . . , c 1 ) q -1 is obtained using the mirror formula in Remark 5.4. B.2. Cluster variables and F -polynomials. We translate the above results in the language of cluster algebras [START_REF] Fomin | Cluster algebras[END_REF] for the readers familiar with this language. We will use the notation of [START_REF] Fomin | Cluster algebras[END_REF][START_REF] Derksen | Quivers with potentials and their representations II: applications to cluster algebras[END_REF].

The weights (x i,j ), attached to the edges of the triangulation T r/s and satisfying (B.1), can be viewed as cluster variables in the algebra A(x, y, B r/s ), where B r/s is the opposite of the matrix of incidence of the graph G r/s defined in Section 3.1. The variables x = (x 1 , . . . , x n-3 ) are the weights of the diagonals d 1 , . . . , d n-3 of T r/s numbered from left to right. The variables y = (y 1 , . . . , y n-3 ) can be considered as products of 'frozen variables' (i.e. weights on the sides of the triangulated n-gon), namely

y j = h x h-1,h i x -1 i-1,i ,
where the edges [h -1, h] and [i -1, i] are sides belonging to the quadrilateral defined by d j , which have a positive incidence, resp. negative incidence, with the diagonal d j .

In this setting, the weights x 0,k+1 and x 1,k+1 are cluster variables. They correspond to the cluster variables with denominators x 1 x 2 . . . x n-3 and x c1 x c1+1 . . . x n-3 respectively. Let us denote by F 0,k+1 (y 1 , . . . , y n-3 ) and F 1,k+1 (y 1 , . . . , y n-3 ) the corresponding F -polynomials.

When the weights (x i,j ) satisfy the initial assignment (B.2), one gets y j = q for all j and Proposition B.1 then can be reformulated as follows.

Corollary B.4. One has x 0,k+1 = q 3-n F 0,k+1 (q, . . . , q), x 1,k+1 = q 3-n F 1,k+1 (q, . . . , q).

In particular one obtains R(q) = F 0,k+1 (q, . . . , q), S(q) = F 1,k+1 (q, . . . , q), where R S = r s q .

Example B.5. We go over the examples of the rationals r s = 5 2 , 5 3 and 7 5 , as in Examples 2.2 and 3.2. The F -polynomials can be computed from the graphs G r/s with opposite orientations and Bernhard Keller's applet [START_REF] Keller | Quiver mutation in Java[END_REF].

For r s = 5 2 , we consider the graph 1 → 2 ← 3. We compute the F -polynomials F 03 and F 13 corresponding to the cluster variables of denominators x 1 x 2 x 3 and x 3 respectively. We find F 03 = 1 + y 1 + y 3 + y 1 y 3 + y 1 y 2 y 3 , F 13 = 1 + y 3 .

One checks [ 5 2 ] q = 1+2q+q 2 +q 3 1+q = F03(q,q,q) F13(q,q,q) . For r s = 5 3 , we consider the graph 1 ← 2 → 3. We compute the F -polynomials F 03 and F 13 corresponding to the cluster variables of denominators x 1 x 2 x 3 and x 2 x 3 respectively. We find F 03 = 1 + y 2 + y 1 y 2 + y 2 y 3 + y 1 y 2 y 3 , F 13 = 1 + y 2 + y 2 y 3 .

One checks [ 5 3 ] q = 1+q+2q 2 +q 3 1+q+q 2 = F03(q,q,q) F13(q,q,q) . For r s = 7 5 , we consider the graph 1 ← 2 ← 3 → 4. We compute the F -polynomials F 04 and F 14 corresponding to the cluster variables of denominators x 1 x 2 x 3 x 4 and x 2 x 3 x 4 respectively. We find F 04 = 1 + y 3 + y 2 y 3 + y 3 y 4 + y 1 y 2 y 3 + y 2 y 3 y 4 + y 1 y 2 y 3 y 4 , F 14 = 1 + y 3 + y 2 y 3 + y 3 y 4 + y 2 y 3 y 4 .

One checks [ 7 5 ] q = 1+q+2q 2 +2q 3 +q 4 1+q+2q 2 +q 3 = F04(q,q,q,q) F14(q,q,q,q) . Remark B.6. Let us mention that the F -polynomial F 0,k+1 (y 1 , . . . , y n-3 ) can be described using the closures of the graph G r/s . For C a closure of the graph we use the following notation

ε i,C = 1 if i ∈ C 0 if i ∈ C .
One has the following expression of the F -polynomial where the sum runs over all the closures C of G r/s . This is a particular case of a result from [START_REF] Derksen | Quivers with potentials and their representations II: applications to cluster algebras[END_REF].

Remark B.7. F -polynomials can be used to compute Jones polynomials of rational knots; see [START_REF] Lee | Cluster algebras and Jones polynomials[END_REF]. Let us consider weights (x i,j ) on the triangulation T r/s satisfying the Ptolemy relations (B.1) and the same initial assignment (B.2) except for the weight on the side [0, n -1] that we change to x 0,n-1 = q -1 . In this case we, obtain x 0,k+1 = q 3-n F 0,k+1 (q 2 , q, . . . , q)

where as above F 0,k+1 is the F -polynomial corresponding to the longest cluster variable in A(x, y, B r/s ). It was proved in [START_REF] Lee | Cluster algebras and Jones polynomials[END_REF] that the above specialization of F 0,k+1 gives precisely the normalized Jones polynomial J r s (q). For instance for r s = 8 3 = [2, 1, 1, 1] = 3, 3 the corresponding graph is 1 → 2 ← 3 → 4, and we compute F 03 = 1 + y 1 + (1 + y 1 + y 1 y 2 )y 3 + ((1 + y 1 + y 1 y 2 )y 3 )y 4

On obtains F 03 (q 2 , q, q, q) = 1 + q + 2q 2 + q 3 + 2q 4 + q 5 = J 8/3 (q) see Section A.4(b), whereas F 03 (q, q, q, q) = 1 + 2q + 2q 2 + 2q 3 + q 4

is the numerator of [ 8 3 ] q , see Example 1.2(d).

3. 2 .

 2 Closure subsets. Let us recall a standard notion of graph theory. Definition 3.4. Given an oriented graph G, a set of vertices C ⊂ G is called a closure if there are no outgoing edges from the elements of C to vertices in the complement G \ C.

Theorem 4

 4 will be proved in Section 3.4. Let us give some examples. Example 3.5. (a) Continuing Example 3.2, the graph G 5/2 has:

4. 1 .

 1 Matrices of convergents. We briefly recall the way to represent classical continued fractions by 2 × 2 matrices. Given a rational r s and its continued fractions expansions r s = [a 1 , . . . , a 2m ] = c 1 , . . . , c k , consider the matrices

Definition 4 . 2 .

 42 (i) The matrix(4.1)

Corollary 4 . 8 .

 48 Let (c 1 , . . . , c n ) be a sequence of positive integers.

4. 7 .Figure 2 . 7 5 , 8 3

 7278 Figure 2. The triangulation T 7 5 , 8 3 is a decagon with the quiddity sequence (c 1 , . . . , c 10 ) = (3, 3, 1, 2, 4, 3, 1, 2, 4, 1), the polynomial X 7 5 , 8

Lemma 4 . 10 .

 410 There exists an integer c ≥ 0 such thatX r s , r s = q c R k, .Proof. By construction of T r s , r s , one has R S = c 1 , . . . , c k-1 and R S = c 1 , . . . , c k , where (c 1 , . . . , c k ) is a sequence that can be obtained from (c 1 , . . . , c -1 ) by applying a sequence of local surgery operations (4.5).

1 o o 2 o o 3 G G 4 o o 5

 135 There are -1 zero-closure, -1 one-closure: the sink 4, -2 two-closures: (1,2), (4,5), -1 three-closures: (1,2,3), -2 four-closures: (1,2,3,4), (1,2,4,5), -1 five-closure. Proposition B.1. If (x i,j ) are the weights of the edges of T r/s satisfying (B.1) and (B.2), then one has

F 0 ,

 0 k+1 (y 1 , . . . , y n-3 ) =

  4. Examples. One can use the online atlas of knots to study examples of rational knots. (a) Consider the knot 7 4 in Rolfsen's Knot Table (see katlas.org).

	This knot is a rational knot
	parametrized by 15 4 = [3, 1, 2, 1] = 4, 4 . It can be represented with the following diagram:

  5 + 2q 6 + q 7 .

	One immediately checks V 15/4 (t) = -t 8 J 15/4 (-t -1 ).
	The coefficients can be recovered by counting the closures that do not isolate the first vertex of the
	following graph
	1 o o	2 o o	3 o o	4	G G 5 o o	6 o o	7
	There are
	-1 zero-closure,
	-1 one-closure: the sink 5,
	-2 two-closures: (1,2), (5,6),
	-3 three-closures: (1,2,3), (1,2,5), (5,6,7),
	-2 four-closures: (1,2,3,5), (1,2,5,6)
	-3 five-closures: (1,2,3,4,5), (1,2,3,5,6), (1,2,5,6,7)
	-2 six-closures (1,2,

In projective duality straight lines become points, and the points of intersection of lines become lines joining them.

Acknowledgements. We are grateful to Frédéric Chapoton and Vladimir Fock for their interest and a number of useful comments; special thanks are due to Frédéric Chapoton for an efficient computer program. This paper was partially supported by the ANR project SC3A, ANR-15-CE40-0004-01.

Therefore, the convergents of [2, 2, 2, 2, . . .] q are of the form

where (P n (q)) n≥1 is the series of polynomials starting from P 1 (q) = 1, P 2 (q) = 1 + q and satisfying the recurrence P 2 +1 = (1 + q) P 2 + q 4 P 2 -1 ,

for ≥ 1, and where Pn satisfy the same recurrence with reversed parity:

The triangle of the coefficients, P n,j , of the polynomials P n starts as follows The triangle of the coefficients, Pn,j , of the polynomials Pn is the mirror of the triangle P n,j . The sums of the numbers in the rows are the classical Pell numbers: 1, 2, 5, 12, 29, 70, 169, 408, 985, 2378, . . . Note that the above triangle of positive integers is not in the OEIS, and we did not find the polynomials P n in the literature.

It follows from Theorem 4 that the coefficient P n,j is equal to the number of j-vertex closures of the following graph with 2n -4 vertices

It also follows from Theorem 4 that the Pell number P n counts the total number of closures of the above graph. This seems to be a new interpretation of the classical Pell numbers.

Closing remarks and open questions

In this final section we formulate some open questions and conjectures that arose as a result of experimentation with q-rationals.

Unimodality conjecture. For all examples of q-rationals we considered so far, the numerator and denominator, R and S, both have the following unimodality property. The coefficients of the polynomials R and S monotonously increase from 1 to the maximal value (that can be taken by one or more Appendix B. Ptolemy relations and q-continued fractions

We present here the q-analogue of the results of [24, §1.5]. This consists in recovering the polynomials R and S of the q-rational [ r s ] q by applying Ptolemy relations in the triangulation T r/s . This will be also reformulated in the language of cluster algebras. B.1. Ptolemy weights. Consider the triangulation T r/s associated with the rational number

The vertices in the triangulation are numbered from 0 to n-1 as in §2.1. For all i, j we assign a weight x i,j to the edge joining the vertices i and j, which is a value in Z[q]. Note that these weights are not the same as the ones defined on the weighted triangulation T q r/s inSection 2.3. The weights (x i,j ) must satisfy the following system of Ptolemy relations (B.1)

The weights (x i,j ) are uniquely determined from the "initial weights" which are the weights of the sides and diagonals of the triangulation T r/s . 1 q q 2 q -a1 q a1+...+a2m-1-1

q -(n-2) q -(n-3) q -(a1+1) q -(a1+2) We assign the following initial values to the sides and diagonals of T rs , see Figure 3. We number the triangles from 0 to n -3 from left to right and we set (B.2)

is the base of the -th triangle and the triangle is base down; q -, if [i, j] is the base of the -th triangle and the triangle is base up; 1, otherwise.

The q-analogue of [24, Fact 3 p7] is the following statement.