A Formula for the HOMFLY Polynomial of rational links
We give an explicit formula for the HOMFLY polynomial of a rational link (in particular, knot) in terms of a special continued fraction for the rational number that defines the given link [after this work was accomplished, the authors learned about a paper by Nakabo (J. Knot Theory Ramif 11(4):565–574, 2002Nak) where a similar result was proved. However, Nakabo’s formula is different from ours, and his proof is longer and less clear].
Keywords
Chebyshev polynomials
M. Shkolnikov is supported by the Swiss National Science Foundation grant 140666
eS. Duzhin is supported by Grants NSh4850.2012.1 and RFBR 130100383
1 Rational links
Rational (or 2bridge) knots and links constitute an important class of links for which many problems of knot theory can be completely solved and provide examples often leading to general theorems about arbitrary knots and links. For the basics on rational (2bridge) knots and links we refer the reader to [Lickorish1997] and [Murasugi1996]. As regards the definition, we follow [Lickorish1997], while the majority of properties that we need, are to be found in a more detailed exposition of [Murasugi1996]. In particular, by equivalence of (oriented) links $L=K_{1}\cup K_{2}$ and $L^{\prime}=K_{1}^{\prime}\cup K_{2}^{\prime}$ we understand a smooth isotopy of $\R^{3}$ which takes the union $K_{1}\cup K_{2}$ into the union $K_{1}\cup K_{2}$, possibly interchanging the components of the link.
Let $p$ and $q$ be mutually prime integers, $q>0$, $\left{p\over q}\right\leq 1$, and we have a continued fraction
${p\over q}=\cfrac{1}{b_{1}+\cfrac{1}{b_{2}+\cfrac{1}{\cdots+\cfrac{1}{b_{n1}+% \cfrac{1}{b_{n}}}}}}\ ,$  (1) 
where $b_{i}$ are nonzero integers (positive or negative). Below, we will use shorthand notation $[b_{1},b_{2},\ldots,b_{n}]$ for the continued fraction with denominators $b_{1},b_{2},\ldots,b_{n}$. A theorem of Schubert (see, for instance, [Lickorish1997]; [Murasugi1996]) says that the (isotopy type of the) resulting unoriented link does not depend on the choice of the continued fraction for the given number $p/q$.
The case $p=q=1$ is exceptional: it corresponds to the trivial knot which is the only rational, but not 2bridge knot. On some occasions, it will be helpful to allow the numbers $b_{i}$ also take values 0 and $\infty$ subject to the rules $1/0=\infty$, $1/\infty=0$, $\infty+x=\infty$.
Consider a braid on four strands corresponding to the word $A^{b_{1}}B^{b_{2}}A^{b_{3}}\ldots$, where $A$ and $B$ are fragments depicted in Fig. 1 and concatenated from left to right.
Then take the closure of this braid depending on the parity of $n$ (see Fig. 2).
We will call (nonoriented) diagrams obtained in this way natural diagrams of rational links and denote them by $D[b_{1},b_{2},\ldots,b_{n}]$. We shall denote the link represented by this diagram as $L\left({p\over q}\right)$. For odd denominators $L\left({p\over q}\right)$ turns out to be a knot, while for even denominators it is a twocomponent link. Such knots and links are called 2bridge or rational.
Example.
We have, among others, the following two continued fractions for the rational number 4/7 (we use shorthand notation, see page 2):
$\displaystyle{4\over 7}=[1,1,3]=[2,4].$ 
These fractions correspond to the natural link diagrams shown in Fig. 3.
2 Orientations
Note that, if a natural diagram represents a twocomponent link, then the two vertical leftmost fragments belong to different components. If they are oriented in the same direction, as shown in Fig. 4, then we call the diagram positive and denote it by $D^{+}[b_{1},b_{2},\ldots,b_{n}]$.
If the orientation of one of the components is reversed, then we call it negative and denote by $D^{}[b_{1},b_{2},\ldots,b_{n}]$. It does not matter which component of the link is reversed, because the change of orientation of both components yields the same link, see [Murasugi1996]. As we will see later (Lemmas 3, 4), the choice between the corresponding links does not depend on a particular continued fraction expansion of the number $p/q$. This makes the notations $L^{+}(p/q)$ and $L^{}(p/q)$ welldefined.
Let $p^{\prime}=pq$, if $p>0$, and $p^{\prime}=p+q$, if $p<0.$ According to [Murasugi1996], we have: $L^{}\left({p\over q}\right)=L^{+}({p^{\prime}\over q})$, therefore, in principle, it is sufficient to study only the totality of all positive rational links. In the case of knots (when $q$ is odd), the two oppositely oriented knots are isotopic, and we have $L\left({p\over q}\right)=L\left({p^{\prime}\over q}\right)$ (again, see [Murasugi1996]). Therefore, it is sufficient to study only the knots with an even numerator (cf. Lemma 2 below).
Another important operation on links is the reflection in space; it corresponds to the change of sign of the corresponding rational number: $p/q\mapstop/q$, see [Murasugi1996].
The two symmetry operations on rational links generate a group $\mathbb{Z}_{2}\times\mathbb{Z}_{2}$; they are transparently exemplified by the examples $p/q=1/4,1/4,3/4,3/4$, which correspond to the four versions of the so called Solomon knot (although it is actually a twocomponent link):
By dragging the lower strand of the diagram for $L(3/4)$ upwards we get the diagram for $L(1/4)$ with the opposite orientation of the upper strand. The same is true for the pair $L(3/4)$ and $L(1/4)$.
3 HOMFLY Polynomial
In 2004–2005 Japanese mathematicians [Fukuhara2005] and [Mizuma2004] found independently different explicit formulae for the simplest invariant polynomial of 2bridge links: the Conway (Alexander) polynomial. The aim of the present paper is to establish a formula for a more general HOMFLY polynomial $P$ in terms of the number $p/q$ that defines the rational link.
The HOMFLY polynomial ([Lickorish1997]; [Prasolov and Sossinsky1997]; [Chmutov et al.2012]) is a Laurent polynomial in two variables $a$ and $z$ uniquely defined by the following relations (we use the normalization of [Knot Atlas2015]; [Chmutov et al.2012]; other authors may write the same polynomial in different pairs of variables, for example, [Lickorish1997] uses $l=\sqrt{1}a$ and $m=\sqrt{1}z$):
$P(\bigcirc)=1,\ aP(L_{+})a^{1}P(L_{})=zP(L_{0}),$  (2) 
where $L_{+}$, $L_{}$ and $L_{0}$ are links that differ inside a certain ball as shown in Fig. 5.
As we mentioned in the previous section, in the case of rational knots, the change of orientation gives the same (isotopic) knot, while for links it is important to distinguish between the two essentially different orientations (this number is two, not four, because the change of orientation on both components gives the same rational link).
There is a simple formula relating the HOMFLY polynomials of a knot (link) with that of its mirror reflection ($a\mapstoa^{1}$, $z\mapsto z$), so in principle it is enough to study only the knots (links) described by positive fractions.
4 Reduction Formula
Consider a family of links $L_{n}$ for $n$ even, which coincide everywhere but in a certain ball, where they look as shown in Fig. 6a–c. Moreover, we define the link $L_{\infty}$ by Fig. 6d. That is, we consider a family of links with a distinguished block where the strands are counterdirected. A formula similar to what we are going to prove, can also be established for codirected strands, but for our purposes the following Proposition is sufficient. It expresses the value $P(L_{n})$ through $P(L_{0})$ and $P(L_{\infty})$.
Lemma 1.
$\displaystyle P(L_{n})=a^{n}P(L_{0})+z{{1a^{n}}\over{aa^{1}}}P(L_{\infty}).$ 
Proof.
Proceed by induction on $n$.

(1)
For $n=0$ the assertion is trivially true.

(2)
Suppose it is true for $n2$ . The skein relation ( 2 ) shows that $zP(L_{\infty})=aP(L_{n2})a^{1}P(L_{n})$ . Substituting here the assumed formula for $P(L_{n2})$ , we can express $P(L_{n})$ as follows:
$\displaystyle P(L_{n})$ $\displaystyle=a^{2}P(L_{n2})zaP(L_{\infty})$ $\displaystyle=a^{2}\big(a^{n2}P(L_{0})+z{1a^{n2}\over aa^{1}}P(L_{\infty}% )\big)zaP(L_{\infty})$ $\displaystyle=a^{n}P(L_{0})+z\big(a^{2}{1a^{n2}\over aa^{1}}a\big)P(L_{% \infty})$ $\displaystyle=a^{n}P(L_{0})+z{1a^{n}\over aa^{1}}P(L_{\infty}).$ The positive branch of induction is thus proved.

(3)
Suppose the assertion holds for a certain value of $n$ . Prove it for the value $n2$ . To do so, it is enough to reverse the argument in the previous item. This completes the proof of the proposition. $\square$
Remark.
For even values of $n$ the fraction $(1a^{n})/(aa^{1})$ is actually a Laurent polynomial, namely, $aa^{3}\cdotsa^{n1}$, if $n>0$, and $a^{1}+a^{3}+\cdots+a^{n+1}$, if $n<0$.
Corollary 1.
Let $T_{2,n}$ be the torus link with counterdirected strands $($shown in the picture on the right$)$. Then $\displaystyle{P(T_{2,n})=z^{1}a^{n}(aa^{1})+z{{1a^{n}}\over{aa^{1}}}}$.
Proof.
Notice that $n$ is even. Consider the family of links $L_{m}=T_{2,m}$, where $m$ is an arbitrary even number. Outside of the grey ellipse all the links of this family are the same, and inside it they look as shown on Fig. 6. Therefore, we fall under the assumptions of Lemma 1, and it only remains to note that $P(L_{0})=z^{1}(aa^{1})$ and $P(L_{\infty})=1$. $\square$
Particular cases of this Corollary for $n=0,\ \pm 2,\ \pm 4$ give the wellknown values of the HOMFLY polynomial for the two unlinked circles, the Hopf link and the two (out of the total four) versions of the oriented “Solomon knot”, see Fig. 7.
5 Canonical Orientation of Rational Links
Lemma 2.
Suppose the numbers $p$ and $q$ are mutually prime and $\left{p\over q}\right<1$. The number ${p\over q}$ has a continued fraction expansion with nonzero even denominators if and only if the product $pq$ is even, and if such an expansion exists, it is unique.
Proof.

(1)
Necessity: if $p/q=[b_{1},b_{2},\ldots,b_{n}]$ with all $b_{i}$ ’s even, then $pq$ is even. We shall prove that by induction on the length $n$ of the continued fraction. The induction base is evident. Now,
$\displaystyle{p\over q}=[b_{1},b_{2},\ldots,b_{n}]={1\over b_{1}+[b_{2},\ldots% ,b_{n}]}={1\over b_{1}+p^{\prime}/q^{\prime}}={q^{\prime}\over b_{1}q^{\prime}% +p^{\prime}}.$ By the induction assumption, one (and only one!) of $p^{\prime}$ or $q^{\prime}$ is even. Since $b_{1}$ is even, it follows that either the numerator or the denominator of the last fraction is even, so their product is even and, since the numbers $p^{\prime}$ and $q^{\prime}$ are mutually prime and ${p^{\prime}}<{q^{\prime}}$ , this fraction is irreducible and smaller than 1 by absolute value.

(2)
Sufficiency: if the product $pq$ is even, then the irreducible fraction $p/q$ allows for a continued fraction with even denominators.
If $q=\pm 2$ , then the expansion clearly exists. We proceed by induction on $q$ . Among the numbers $[{q\over p}]$ and $[{q\over p}]+1$ one is even, call it $b$ . The number $b{q\over p}$ can be written as an irreducible fraction ${p^{\prime}\over q^{\prime}}$ . Note that $b$ cannot be 0, because $q/p>1$ . Then ${p^{\prime}\over q^{\prime}}<1$ and ${p\over q}={1\over{b+{p^{\prime}\over q^{\prime}}}}$ , where we have $q^{\prime}<q$ . Similarly to the argument in the previous section we infer that the product $p^{\prime}q^{\prime}$ is even. By the induction assumption ${p^{\prime}\over q^{\prime}}$ has a continued fraction expansion with even denominators. This completes the proof of sufficiency.
We proceed to the proof of uniqueness, using induction on the length of the continued fraction. For $p=1$ the assertion is trivial. Suppose that
$\displaystyle[b_{1},b_{2},\ldots,b_{n}]=[c_{1},c_{2},\ldots,c_{n}]$ where all the numbers $b_{i}$ and $c_{i}$ are even, and several last terms of the sequence $c_{i}$ may be $\infty$ (which means that this sequence is actually shorter than the first one). Then
$\displaystyle b_{1}+[b_{2},\ldots,b_{n}]=c_{1}+[c_{2},\ldots,c_{n}].$ Therefore,
$\displaystyleb_{1}c_{1}=\left[b_{2},\ldots,b_{n}][c_{2},\ldots,c_{n}]% \right<2$ But the number $b_{1}c_{1}$ is even, hence $b_{1}=c_{1}$ .
The lemma is proved. $\square$
The continued fraction expansion with even denominators and the corresponding natural diagram will be referred to as the canonical expansion of a rational number and the canonical diagram of a rational link (defined up to a rotation, see Lemma 4).
Remark.
The parity of the denominator of a rational number is always opposite to the parity of the length of its even (canonical) continued fraction expansion. That is, for knots the canonical expression is of even length, while for links it is of odd length.
Now we are in a position to define a canonical oriented rational link.
Let
$\displaystyle{p\over q}=[b_{1},b_{2},\ldots,b_{n}]=\cfrac{1}{b_{1}+\cfrac{1}{b% _{2}+\cfrac{1}{\cdots+\cfrac{1}{b_{n1}+\cfrac{1}{b_{n}}}}}},$ 
where $q$ and all $b_{i}$ are even. The diagram $D[b_{1},\ldots,b_{n}]$ taken with the positive orientation, denoted by $D^{+}[b_{1},\ldots,b_{n}]$, will be referred to as the canonical diagram of the oriented link $L^{+}(p/q)$.
We will use the canonical diagrams for the proof of the main theorem. However, for this theorem to make sense, we must check that the oriented link $L^{+}(p/q)$ does not depend on a particular choice of the continued fraction for the rational number $p/q$ and, especially, that it does not change when $p/q$ is changed by $\bar{p}/q$ where $p\bar{p}\equiv 1\mod 2q$. We will prove these facts immediately.
Lemma 3.
Suppose that $p/q=[b_{1},\ldots,b_{n}]=[c_{1},\ldots,c_{m}]$ where $b_{i}$ and $c_{i}$ are nonzero integers. Then the natural diagram $D^{+}[b_{1},\ldots,b_{n}]$ and $D^{+}[c_{1},\ldots,c_{m}]$ are oriented isotopic.
Proof.
We will prove that every natural diagram $D^{+}[b_{1},\ldots,b_{n}]$ is oriented isotopic to the canonical (even) natural diagram. To do so, we follow the induction argument used in Lemma 2 (sufficiency part). In fact, the induction step used there consists of one of the two transformations on the sequence $\{b_{1},b_{2},\ldots,b_{n}\}$:

(1)
$[S,s,t,T]\longmapsto[S,s+1,1,1t,T]$ , if $t>0$ ,

(2)
$[S,s,t,T]\longmapsto[S,s1,1,1t,T]$ , if $t<0$ ,
where $s,t$ are arbitrary integers and $S,T$ are arbitrary sequences.
The algorithm is to find the first from the left occurrence of an odd number and apply one of these rules. If $T=\emptyset$ and $t=\pm 1$, then we use the rule $[S,s,\pm 1]\mapsto[S,s\pm 1]$ instead. Note that the situation when all numbers $b_{i}$, $1\leq i\leq n1$ are even, while $b_{n}$ is odd, is impossible, because it corresponds to a knot rather than to a twocomponent link.
The Proof of Lemma 2 assures that, in this process, the denominator of the rational fraction monotonically decreases, and thus the algorithm is finite.
Each step of the algorithm, when depicted on natural diagrams, shows that during this process the equivalence of oriented links is preserved (even with numbering of components). $\square$
The previous lemma justifies the notation $L^{+}(p/q)$.
Lemma 4.
If $p\bar{p}\equiv 1\mod 2q$, then the links $L^{+}(p/q)$ and $L^{+}(\bar{p}/q)$ are oriented isotopic.
Proof.
Making the rotation of the canonical diagram $D^{+}[b_{1},b_{2},\ldots,b_{n}]$ around a vertical axis, we obtain the canonical diagram $D^{+}[b_{n},b_{n1},\ldots,b_{1}]$, and it is easy to show (by induction on $n$) that these two continued fractions have the same denominators, and their numerators are related as indicated in the statement of the lemma. (Remind that, for links, the number $n$ is odd). We see that the two corresponding links are isotopic with the orientation of both components changed. But the total change of orientation is a link equivalence (see [Murasugi1996]). $\square$
In a canonical diagram of a rational link, due to the fact that all blocks are of even length, the strands are everywhere counterdirected. Therefore, Lemma 1 can be applied recursively:
$\displaystyle P(D^{+}[b_{1},\ldots,b_{n}])$  
$\displaystyle\quad=a^{\varepsilon_{n}b_{n}}P(D^{+}[b_{1},\ldots,b_{n1},0])+z{% {1a^{\varepsilon_{n}b_{n}}}\over{aa^{1}}}P(D^{+}[b_{1},\ldots,b_{n1},% \infty])$  
$\displaystyle\quad=a^{\varepsilon_{n}b_{n}}P(D^{+}[b_{1},\ldots,b_{n2}])+z{{1% a^{\varepsilon_{n}b_{n}}}\over{aa^{1}}}P(D^{+}[b_{1},\ldots,b_{n1}]),$  (3) 
because the following two pairs of diagrams are equivalent as links: $D^{+}[b_{1},\ldots,{}b_{n1},0]=D^{+}[b_{1},\ldots,b_{n2}]$ and $D^{+}[b_{1},\ldots,b_{n1},\infty]=D^{+}[b_{1},\ldots,b_{n1}]$. The sign $\varepsilon_{n}=(1)^{n1}$ comes from our convention of counting the number of twists in the first and the second layers of a natural diagram (see Fig. 1—the powers of $A$ and $B$ correspond to odd and even values of $n$, respectively).
For a given sequence $[b_{1},\ldots,b_{n}]$ denote $x_{n}=P(D^{+}[b_{1},\ldots,b_{n}])$. Then Eq. (5) can be rewritten as
$x_{n}=z{{1a^{(1)^{n1}b_{n}}}\over{aa^{1}}}x_{n1}+a^{(1)^{n1}b_{n}}x_{n% 2}$  (4) 
which makes sense when $n>2$. Drawing the diagrams and applying skein relation (2) for the cases $n=2$ and $n=1$, we can see that Eq. (4) still holds for these values, if we set $x_{0}=1$ and $x_{1}=z^{1}(aa^{1})$.
6 Main Theorem
Our aim is to find a closed form formula for $x_{n}$ in terms of $a$ and $z$. To do this, it is convenient to first consider a more general situation.
Lemma 5.
Let $r_{n}$ and $l_{n}$ be elements of a certain commutative ring $R$. Define recurrently the sequence $x_{n}$, $n\geq1$, of elements from $R$ by the relation
$\displaystyle x_{n}=zl_{n}x_{n1}+r_{n}x_{n2},\ n\geq 1,$ 
where $z,$ $x_{1}$ and $x_{0}$ are fixed elements of $R$. Let $C$ be the set of all integer sequences $c=\{c_{1},c_{2},\ldots,c_{N}\}$ where $c_{1}>c_{2}>\cdots>c_{N}$, $c_{1}=n$, $c_{i}c_{i+1}=1\text{ or }2$, $c_{N}=0\text{ or }1$, and only one of the numbers 0 and $1$ is present in the sequence $c$ (that is, if $c_{N}=1$, then $c_{N1}\not=0$). Then $x_{n}$ can be expressed as the following polynomial in $z$ with coefficients depending on the elements $l_{i}$, $r_{i}$ and the initial conditions $x_{0}$, $x_{1}$:
$\displaystyle x_{n}=\sum_{c\in C}z^{k(c)}x_{c_{N}}\prod_{i\in\lambda(c)}l_{c_{% i}}\prod_{i\in\rho(c)}r_{c_{i}},$ 
where $\lambda(c)=\{i\mid c_{i}c_{i+1}=1\}$, $\rho(c)=\{i\mid c_{i}c_{i+1}=2\}$ and $k(c)=\lambda(c)=\#\{i\mid c_{i}c_{i+1}=1\}$.
Proof.
Essentially, the written formula describes the computational tree for the calculation of $x_{n}$. Note that the recurrence is of depth 2, that is, the element $x_{n}$ is expressed through $x_{n1}$ and $x_{n2}$. Therefore, the computational tree is best represented as a layered tree where each layer matches the $l_{i}$’s and $r_{i}$’s with the same $i$. We draw the $l$edges (of length 1) to the left and the $r$edges (of length 2) to the right. The exponent of $z$ for each directed path from the vertex at level $n$ to a vertex at levels 0 or $1$ in this tree corresponds to the number of lefthand edges. Any path in such a tree is uniquely determined by a sequence of levels $c$ with the above listed properties. In the picture, you can see an example of such a tree for $n=5$.
Remark.
In the special case when $R=\mathbb{Z}[z]$ is a ring of integer polynomials, $l_{k}=2,$ $r_{k}=1$ for all $k,$ and $x_{1}=0,$ $x_{0}=1,$ the sequence of polynomials $x_{n}=U_{n}(z)$ defined by the recursive relation in Lemma 5 coincides with a sequnce of all Chebyshev polynomials of the second kind.
To obtain the formula for the HOMFLY polynomial of an arbitrary rational link $L^{\pm}(p/q)$, we combine Lemma 5 with formula (4). For the sake of unification, we first make some preparations:

•
If $q$ is odd (that is, we deal with a knot) and $p$ is odd, too, then we change $p$ to $p^{\prime}=pq$, if $p>0$, or to $p^{\prime}=p+q$, if $p<0$. Then $L(p/q)=L(p^{\prime}/q)$, the numerator of the fraction becomes even, hence Lemma 2 applies and formula (4) is valid.

•
If $q$ is even and the link is negative, then we use the property $L^{}(p/q)=L^{+}(p^{\prime}/q)$, where $p^{\prime}$ is computed by the same rule as above. Below, we will simply write $L(p/q)$ instead of $L^{+}(p/q)$.
Now the main result reads:
Theorem 1.
Suppose that $p$ is even and $q$ is odd or $p$ is odd and $q$ is even. Let $[b_{1},b_{2},\ldots,b_{n}]$ be the canonical continued fraction for the number $p/q$ (all numbers $b_{i}$ are even, positive or negative, see Lemma 2). Then
$P(L(p/q))=\sum_{c\in C}z^{k(c)}y_{c_{N}}\prod_{i\in\lambda(c)}{1a^{(1)^{c_{i% }1}b_{c_{i}}}\over aa^{1}}\prod_{i\in\rho(c)}a^{(1)^{c_{i}1}b_{c_{i}}},$  (5) 
where

•
$C$ is the set of all integer sequences $c=\{c_{1},c_{2},\ldots,c_{N}\}$ with $c_{1}>c_{2}>\cdots>c_{N}$ , $c_{i}c_{i+1}=1\,{\rm or}\,2$ , $c_{1}=n$ , $c_{N}=0\,{\rm or}\,1$ , and only one of the numbers 0 and $1$ is present in the sequence $c$ (that is, if $c_{N}=1$ , then $c_{N1}\not=0$ ),

•
$\lambda(c)=\{i\mid c_{i}c_{i+1}=1\}$ ,

•
$\rho(c)=\{i\mid c_{i}c_{i+1}=2\}$ ,

•
$k(c)=\lambda(c)=\#\{i\mid c_{i}c_{i+1}=1\}$ ,

•
$y_{0}=1$ and $y_{1}=z^{1}(aa^{1})$ .
Example.
The canonical expansion of the fraction $4/7$ is $[2,4]$. We have $n=2$, and there are three possibilities for the sequence $c$:

(1)
$c=\{2,1,0\}$ , then $\lambda(c)=\{2,1\}$ , $k(c)=2$ , $\rho(c)=\emptyset$ , $c_{l}=0$ ,

(2)
$c=\{2,1,1\}$ , then $\lambda(c)=\{2\}$ , $k(c)=1$ , $\rho(c)=\{1\}$ , $c_{l}=1$ ,

(2)
$c=\{2,0\}$ , then $\lambda(c)=\emptyset$ , $k(c)=0$ , $\rho(c)=\{2\}$ , $c_{l}=0$ ,
Then formula (5) gives:
$\displaystyle P(L(4/7))$  $\displaystyle=z^{2}\cdot{1a^{2}\over aa^{1}}\cdot{1a^{4}\over aa^{1}}+z% \cdot z^{1}(aa^{1})\cdot{1a^{4}\over aa^{1}}\cdot a^{2}+a^{4}$  
$\displaystyle=z^{2}(a^{2}+a^{4})+(a^{2}+a^{4}a^{6})$ 
In formula (5) one can, in principle, collect the terms with equal powers of $z$. The formulation of this result is rather involved, and we need first to introduce necessary notations.
Let $\alpha=p/q$ be a nonzero irreducible rational number between $1$ and 1. We denote by $n=\nu(\alpha)$ the length of the canonical continuous fraction for $\alpha$, and by $\alpha^{\prime}$, the number $\alpha+1$, if $\alpha<0$, and $\alpha1$, if $\alpha>0$. Now, let
$\displaystyle\rho_{k}(\alpha)=\sum_{\substack{{S\subseteq{{\overline{1,n}}},\ % S\cap(S1)=\emptyset\ }\\ {S=(nk)/2}}}\prod_{m\in S}a^{(1)^{m+1}b_{m}}\prod_{\substack{{m\in{% \overline{1,n}}}\\ {m\notin S\cup(S1)}}}(1a^{(1)^{m+1}b_{m}})$ 
where $\overline{1,n}=\{1,2,\ldots,n\}$ and for $S\subset{\overline{1,n}}$ the set $S1$ is understood as the set of all numbers $m1$, where $m\in S$.
Then we have:
Theorem 2.
Let $q$ be odd, that is, $L(\alpha)$ is a knot. Then:

(1)
If $p$ is even, then
$\displaystyle P(L(\alpha))=\sum_{\substack{{{0\leq k\leq\nu(\alpha)}}\\ {k\equiv 0\mod 2}}}z^{k}(aa^{1})^{k}\rho_{k}(\alpha)$ 
(2)
If $p$ is odd, then
$\displaystyle P(L(\alpha))=\sum_{\substack{{{0\leq k\leq\nu(\alpha^{\prime})}}% \\ {k\equiv 0\mod 2}}}z^{k}(aa^{1})^{k}\rho_{k}(\alpha^{\prime})$ Let $q$ be even, that is, $L(\alpha)$ is a twocomponent link. Then:

(3)
If the two components are counterdirected, then
$\displaystyle P(L^{+}(\alpha))=\sum_{\substack{{{1\leq k\leq\nu(\alpha)}}\\ {k\equiv 1\mod 2}}}z^{k}(aa^{1})^{k}\rho_{k}(\alpha)$ 
(4)
If the two components are codirected, then
$\displaystyle P(L^{}(\alpha))=\sum_{\substack{{{1\leq k\leq\nu({\alpha^{% \prime}})}}\\ {k\equiv 1\mod 2}}}z^{k}(aa^{1})^{k}\rho_{k}({\alpha^{\prime}})$
The theorem can be proved by first collecting the terms with equal powers of $z$ in the statement of Lemma 5 and then using induction on $\nu(\alpha)$; we do not give the details here. Although Theorem 2 is in a sense more explicit than Theorem 1, it is less practical; in particular, the formula of Theorem 1 is better suited for programming purposes.
7 Computer Calculations
The formula for $P(L(p/q))$ can be easily programmed. The source code of the program, written by the second author and tested by the first one, as well as the resulting table of HOMFLY polynomials for rational links with denominators not exceeding 1000, are presented online at [Computer generated table of HOMFLY polynomials for rational links2010]. Below, we give a short excerpt of that big table which is enough to know the polynomials of all rational knots and links with denominators no ${<}9$, if one uses the following rules (see [Murasugi1996]):

(1)
$P(L^{+}(p/q))$ is obtained from $P(L^{+}(p/q))$ by the substitution $a\mapstoa^{1}$.

(2)
The knots $L(p_{1}/q)$ and $L(p_{2}/q)$ are equivalent, if $p_{1}p_{2}\equiv 1\mod q$.

(3)
The links $L^{+}(p_{1}/q)$ and $L^{+}(p_{2}/q)$ are oriented equivalent, if $p_{1}p_{2}\equiv 1\mod 2q$.
In Table 1, the first column (R) gives the notation of the rational link (knot) as $L(p/q)$ (in the case of links, this means $L^{+}(p/q)$), the second column (T) contains the standard notation of that link (knot) from Thistlethwaite (Rolfsen) tables (see [Knot Atlas2015]; the bar over a symbol means mirror reflection, the star is for the change of orientation of one component), and the third column (H) is for the values of the HOMFLY polynomial. Note that we list HOMFLY polynomials for both orientations of each rational link, while the famous [Knot Atlas2015] shows them for only one orientation of twocomponent links.
$R$  $T$  $H$ 

$L\left({1\over 2}\right)$  $L_{2}a_{1}$  $z^{1}(a^{3}a)za$ 
$L\left({2\over 3}\right)$  $3_{1}$  $(2a^{2}a^{4})+z^{2}a^{2}$ 
$L\left({1\over 4}\right)$  $L_{4}a_{1}$  $z^{1}(a^{3}+a^{5})+z(aa^{3})$ 
$L\left({3\over 4}\right)$  $L_{4}a_{1}^{*}$  $z^{1}(a^{3}+a^{5})+z(3a^{3}+a^{5})z^{3}a^{3}$ 
$L\left({2\over 5}\right)$  $4_{1}$  $(a^{2}1+a^{2})z^{2}$ 
$L\left({4\over 5}\right)$  $5_{1}$  $(3a^{4}2a^{6})+z^{2}(4a^{4}a^{6})+z^{4}a^{4}$ 
$L\left({1\over 6}\right)$  $L_{6}a_{3}$  $z^{1}(a^{5}+a^{7})+z(aa^{3}a^{5})$ 
$L\left({5\over 6}\right)$  $L_{6}a_{3}^{*}$  $z^{1}(a^{7}a^{5})+z(3a^{7}6a^{5})+z^{3}(a^{7}5a^{5})z^{5}a^{5}$ 
$L\left({2\over 7}\right)$  $5_{2}$  $(a^{2}+a^{4}a^{6})+z^{2}(a^{2}+a^{4})$ 
$L\left({6\over 7}\right)$  $7_{1}$  $(4a^{6}3a^{8})+z^{2}(10a^{6}4a^{8})+z^{4}(6a^{6}a^{8})+z^{6}a^{6}$ 
$L\left({1\over 8}\right)$  $L_{8}a_{14}^{*}$  $z^{1}(a^{7}+a^{9})+z(aa^{3}a^{5}a^{7})$ 
$L\left({3\over 8}\right)$  $\overline{L_{5}a_{1}}$  $z^{1}(a^{1}+a)+z(a^{3}2a^{1}+a)z^{3}a^{1}$ 
$L\left({7\over 8}\right)$  $L_{8}a_{14}$  $z^{1}(a^{9}a^{7})+z(6a^{9}10a^{7})+z^{3}(5a^{9}15a^{7})+z^{5}(a^{9}7a^{7}% )z^{7}a^{7}$ 
$L\left({2\over 9}\right)$  $6_{1}$  $(a^{2}a^{2}+a^{4})+z^{2}(1a^{2})$ 
$L\left({8\over 9}\right)$  $9_{1}$  $(5a^{8}4a^{10})+z^{2}(20a^{8}10a^{10})+z^{4}(21a^{8}6a^{10})+z^{6}(8a^{8}a% ^{10})+z^{8}a^{8}$ 
8 Concluding Remarks

1.
As the Conway polynomial is a reduction of the HOMFLY polynomial, Theorem 1 gives a formula for the Conway polynomial of rational links by the substitutions $a=1$, $z=t$ [the fraction $(1a^{n})/(aa^{1})$ is first transformed to a Laurent polynomial and becomes equal to $n/2$].

2.
Since the Jones polynomial is a reduction of the HOMFLY polynomial, Theorem 1 leads to a formula for the Jones polynomial of rational links by the substitutions $a=t^{1}$, $z=t^{1/2}t^{1/2}$.

3.
The famous open problem whether a knot must be trivial if its Jones polynomial is 1, has a simple positive solution for rational knots. Indeed, the value $J(1)$ is equal to the determinant of the knot, and the determinant of a rational knot is its denominator (see [Murasugi1996]).

4.
Open problem Can one generalize formula (5) to all links? The results of [Traldi1989] show that it can be generalized to at least some nonrational links, although his formula is less explicit than ours.
Acknowledgements
The authors are grateful to M. Karev who read the manuscript and indicated several inaccuracies. We also thank S. Chmutov for pointing out the relation of our investigations with papers [Jaeger1988] and [Traldi1989], and [Traldi1989] for valuable comments on his paper.References
 [Chmutov et al.2012] Chmutov, S., Duzhin, S., Mostovoy, J.: Introduction to Vassiliev knot invariants, Cambridge University Press (2012). ISBN: 9781107020832
 [Computer generated table of HOMFLY polynomials for rational links2010] Computer generated table of HOMFLY polynomials for rational links: Web document. http://www.pdmi.ras.ru/~arnsem/dataprog/ (2010). Accessed 09 Nov 2014
 [Fukuhara2005] Fukuhara, S.: Explicit formulae for twobridge knot polynomials. J. Aust. Math. Soc. 78, 149–166 (2005)
 [Jaeger1988] Jaeger, F.: Tutte polynomials and link polynomials. Proc. Am. Math. Soc. 103(2), 647–654 (1988)
 [Knot Atlas2015] Knot Atlas: http://katlas.math.toronto.edu/ (2015). Accessed 09 Nov 2014. Maintained by Scott Morrison and Dror BarNatan
 [Lickorish1997] Lickorish, W.B.R.: An introduction to knot theory. Springer, New York (1997)
 [Mizuma2004] Mizuma, Y.: Conway polynomials of twobridge knots. Kobe J. Math. 21, 51–60 (2004)
 [Murasugi1996] Murasugi, K.: Knot Theory and Its Applications. Birkhäuser, Boston (1996)
 [Nakabo2002] Nakabo, S.: Explicit description of the HOMFLY polynomials for 2bridge knots and links. J. Knot Theory Ramif. 11(4), 565–574 (2002)
 [Prasolov and Sossinsky1997] Prasolov, V., Sossinsky, A.: Knots, links, braids and 3manifolds. In: Translations of Mathematical Monographs, vol. 154. Am. Math. Soc., Providence (1997)
 [Traldi1989] Traldi, L.: A dichromatic polynomial for weighted graphs and link polynomials. Proc. Am. Math. Soc. 106(1), 279–286 (1989)