Convergence conditions for p-adic continued fractions

Continued fractions have been introduced in the field of p-adic numbers Qp\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {Q}_p$$\end{document} by several authors. However, a standard definition is still missing since all the proposed algorithms are not able to replicate all the properties of continued fractions in R\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {R}$$\end{document}. In particular, an analogue of the Lagrange’s Theorem is not yet proved for any attempt of generalizing continued fractions in Qp\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {Q}_p$$\end{document}. Thus, it is worth to study the definition of new algorithms for p-adic continued fractions. The main condition that a new method needs to fulfill is the convergence in Qp\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {Q}_p$$\end{document} of the continued fractions. In this paper we study some convergence conditions for continued fractions in Qp\documentclass[12pt]{minimal} \usepackage{amsmath} \usepackage{wasysym} \usepackage{amsfonts} \usepackage{amssymb} \usepackage{amsbsy} \usepackage{mathrsfs} \usepackage{upgreek} \setlength{\oddsidemargin}{-69pt} \begin{document}$$\mathbb {Q}_p$$\end{document}. These results allow to define many new families of continued fractions whose convergence is guaranteed. Then we provide some new algorithms exploiting the new convergence condition and we prove that one of them terminates in a finite number of steps when the input is rational, as it happens for real continued fractions.


Introduction
In 1940, Mahler [11] gave the first idea for introducing continued fractions in the field of p-adic numbers Q p . Starting from this, several authors studied the problem of defining an algorithm for expanding elements of Q p in continued fractions. The most notable results were provided by Browkin [4], Ruban [14] and Schneider [15] who defined different p-adic continued fractions algorithms with the aim of obtaining the same good properties that hold in the real case. However, all these algorithms fail in the attempt of characterizing quadratic irrationals by periodic continued fractions, as in the case of R. The study of the periodicity of these algorithms have been deepened by several authors. Schneider's algorithm is not periodic for all quadratic irrationals, but there is an effective criterion to determine when this happens (see [8,16,17]). Ooto [13] proved that an analogue of Lagrange's Theorem does not hold for Ruban's continued fractions and Capuano et al. [7] gave an effective condition to check the periodicity. Moreover, Ruban's and Schneider's algorithms provide finite or periodic expansion for rationals. Browkin's algorithm is of particular interest since it always gives finite representations for rational numbers, but it is not known if an analogue of the Lagrange's Theorem holds. In [2,3], the authors proved some results about the periodicity of this algorithm and Capuano et al. [6] gave some necessary and sufficient conditions for periodicity, but such conditions do not allow to prove that an analogue of Lagrange's Theorem does not hold. From experimental results, it seems very unlikely that Browkin's algorithm provides periodic expansion for any quadratic irrational. For this reason, in 2000, Browkin himself defined a new algorithm [5] and it has been proved in [1] that also this second algorithm produces a finite continued fraction for rational numbers. Browkin's second algorithm works better on quadratic irrationals, but also in this case they do not always present periodic expansions in continued fractions. The periodicity of this algorithm has been investigated in [12]. Further studies on p-adic continued fractions can be found in [9,10,18,19]. Thus, it is worth to study the definition of new algorithms for p-adic continued fractions.
In this paper, we give a sufficient condition on the partial quotients of a p-adic continued fractions in order to achieve the convergence in Q p . In particular, we study a condition that allows to extend the idea of Browkin in [5], giving space to several possible new definitions of p-adic continued fractions. Exploiting this condition, we then propose a new p-adic continued fraction algorithm that is a natural generalization of the construction performed in [5] for the second algorithm of Browkin. Moreover, we also prove that this new algorithm terminates in a finite number of steps on each α ∈ Q.

Preliminaries
Let us denote with v p (·) and | · | p , respectively, the p-adic valuation and the p-adic absolute value over Q, where p is an odd prime. The Euclidean norm will be denoted as usual by | · |. We denote a continued fraction of a value α with the usual notation as Moreover, we call A n B n , for all n ∈ N, the convergents of the continued fraction, that may be defined recursively by using the well-known formulas The first important requirement when designing an algorithm for p-adic continued fractions is that all the expansions converge to a p-adic number, that is The first algorithm proposed by Browkin in [4] works as follows. Starting from an input α 0 ∈ Q p then the partial quotients of the p-adic continued fraction are evaluated by where s : Q p → Q is defined by for a p-adic number α = +∞ n=−r a n p n ∈ Q p , with r ∈ Z and a n ∈ {− p−1 2 , . . . , p−1 2 }. In this algorithm, the function s plays the same role of the floor function in the classical algorithm of continued fractions in R. Ruban's algorithm [14] employs the same function s, with the only difference that the representatives are taken in {0, . . . , p − 1}. More than 20 years later, Browkin defines another algorithm in [5], where starting from α 0 ∈ Q p , the partial quotients b n , for n ≥ 0, are evaluated by where t : Q p → Q is another function defined for any p-adic value α = +∞ n=−r a n p n as n=−r a n p n , with r ∈ Z and a n ∈ {− p−1 2 , . . . , p−1 2 }. In the following we will refer to (1) and (2) respectively as Browkin I and Browkin II.
The convergence in Q p of the continued fractions generated by Browkin I is based on the following lemma. For what concerns Browkin II, the p-adic convergence relies on the following lemma.
Then the continued fraction [b 0 , b 1 , . . .] is convergent to a p-adic number.

Remark 3
The proofs of Lemmas 1 and 2 exploit the strict decrease of the sequence of valuations v p (B n B n+1 ). Moreover, requiring the sequence v p (B n B n+1 ) strictly decreasing is equivalent to ask that v p (B n+1 ) < v p (B n−1 ) for all n ≥ 1. Thus, the divergence of the sequence of valuations implies the convergence of the correspondent p-adic continued fraction. Indeed, in this way we have that proving that A n B n n∈N is a Cauchy sequence and therefore convergent in Q p .

Convergence of p-adic continued fractions
The reduction of the number of partial quotients having negative valuations shows better properties in terms of the periods of quadratic irrationals, as pointed out in [5]. Therefore a promising approach for the definition of a new algorithm should be a further modification of Browkin II: we may define a "3-steps"-algorithm that generates the partial quotients such that, for all n ∈ N, Such a construction turns out to be more complex than the previous two algorithms defined by Browkin. In the following example we show that a sequence having these constraints does not converge without a stronger hypothesis. In particular, for every prime p, we may construct a suitable continued fraction that does not converge to any p-adic number.
Example 4 Let p be an odd prime. We are going to show that there exists a sequence such that the sequence v p (B n B n+1 ) does not diverge to −∞. Let us define b 1 = 1 p . The first denominators of the convergents are B 0 = 1, we are going to show that there exists a choice for the partial quotients such that We can write We have two cases: • In the case that v p (a 3 + a 2 ) = 0, we choose b 3n+4 = 1 p . Therefore,

Its valuation is
with v p (a 5 ) = 0. At the following step, Notice that a 4 and a 5 are arbitrary elements that are nonzero modulo p and we can choose a suitable b 3n+6 such that b 3n+6 a 5 + a 4 ≡ 0 mod p.
We obtain that p divides b 3n+6 a 5 + a 4 and so v p (B 3n+6 ) ≥ 0. In this case we have obtained that, starting from • Let us examine also the case v p (a 3 + a 2 ) > 0. Here we choose b 3n+4 = 2 p . Since v p (a 2 ) = 0 and v p (a 3 + a 2 ) > 0, necessarily also v p (a 3 ) = 0. The next denominator is Notice that since p divides a 3 + a 2 but does not divide a 3 , it can not divide 2a 3 + a 2 .
where v p (b 3n+5 ) = 0, and so we can write At the next step we have As before, we choose b 3n+6 such b 3n+6 a 5 + a 4 ≡ 0 mod p.
In this way we get v p (B 3n+6 ) ≥ 0. Hence, also in this second case we have obtained that We have just constructed a sequence of denominators B n such that the sequence of can not diverge to −∞. In fact, in particular, v p (B n ) ≥ −1 for all n ∈ N and the p-adic continued fraction is not convergent.
Starting from the observations of the last example, we would like to characterize the strict decrease of the sequence In fact, as we are going to see in the next results, Browkin's hypothesis of b n ∈ Z[ 1 p ] for all n ∈ N, seen in Lemmas 1 and 2, is not needed.
, hence this second case can not occur.
On the other hand it is also possible to prove the following equivalence.
and the claim is proved.
Using the results obtained above, we may prove the following theorem on the characterization of the strict decrease of the sequence v p (B n B n+1 ).

Theorem 7
The following conditions are equivalent: Moreover, let us recall that, in general, If v p (B n−2 ) ≤ v p (b n B n−1 ), then we would have v p (B n ) ≥ v p (B n−2 ), which is a contradiction with the characterization of i) given by Lemma 6. Then v p (B n−2 ) > v p (b n B n−1 ) and it follows that v p (B n ) = v p (b n B n−1 ). Hence, where the last inequality implies v p (b n ) < 0 and this concludes the proof. ii) ⇒ i) Conversely, let us suppose that v p (b n b n+1 ) < 0 for all n ≥ 1. We prove the claim by induction on n. Base step By hypothesis, we have that v p (b 1 b 2 ) < 0 and v p (b 2 b 3 ) < 0. Hence, for n = 1 and n = 2, we have that:

Induction step
Let us suppose that the thesis is true until a step n ≥ 2 and we show it for n + 1.
In this case, using inductive hypothesis and Lemma 5 we get that where the last inequality implies In this case we have

The inductive hypothesis ensures that
and this concludes the proof.
We easily obtain the following corollary, fully characterizing the strict decrease of the sequence of denominators.
In other words, we have proved that the definition of two consecutive partial quotients with zero valuation makes us lose the strict decrease of the valuation. Moreover, the sufficiency of this condition means that every possible definition in this range works. It would be interesting to study some algorithms that satisfy this hypothesis, different from Browkin I and Browkin II. For example, it is possible to define 2 negative partial quotients every 3 steps or partial quotients that are not in Z[ 1 p ], as long as the condition, v p (b n b n+1 ) < 0 for all n ∈ N, is satisfied.

Design of a new algorithm
In Example 4 we have showed that an algorithm generating the partial quotients as in (4) never assures the p-adic convergence of the continued fraction. Moreover, we have characterized the strict decrease of the sequence v p (B n B n+1 ).
However, for the negative divergence of this sequence, we do not need it to be strictly decreasing. So we may wonder in which cases it diverges although it is not strictly decreasing.
What we are going to see here is that adding one additional constraint on the two partial quotients having null valuation it is possible to avoid the growth of the valuation of the denominators B n . In this way we succeed to obtain the convergence of a p-adic continued fraction with only one partial quotient with negative valuation each three steps, as defined in (4).
Proof Let us prove the claim by induction on n.

Induction step
Let us suppose that: In fact, the valuation of B 3n+1 is: since, by induction hypothesis, v p (B 3n ) = v p (B 3n−1 ) and v p (b 3n+1 ) < 0. Recalling that v p (b 3n+4 ) < 0 and v p (b 3n+3 b 3n+2 + 1) = 0, at the following steps we obtain: Hence, we have obtained that and this proves the claim.
Theorem 9 easily leads to the following corollary, achieving the convergence of a p-adic continued fraction generating the partial quotients as in (4). Notice that, for all n ∈ N, since all the three valuations are equal. Moreover, since v p (B 3n+4 ) < v p (B 3n+3 ) and v p (B 3n+3 ) = v p (B 3n+2 ). So, the sequence v p (B n B n+1 ) is decreasing and divergent.

Some new algorithms
Starting from Theorem 9 and Corollary 10, we propose some new algorithms. We use three different functions. For a = +∞ n=−r a n p n ∈ Q p , a n ∈ 0, ±1, ±2, . . . and then the third is: We can now design the form of two new algorithms.

Definition 11 (First new algorithm)
On input α 0 = α, for n ≥ 0, our first new algorithm works as follows: Definition 12 (Second new algorithm) On input α 0 = α, for n ≥ 0, our second new algorithm works as follows:

Remark 13
The choice of the third function u is a little tricky. The function t takes all the negative powers, leaving out the constant term. The function u needs to act on a p-adic number with zero valuation, but it has to leave apart another term with zero valuation, otherwise the third partial quotient will not have null valuation. Clearly, the choice of this function can be done in several ways. In fact, there are a lot of manners to separate the constant term a 0 ∈ {− p−1 2 , . . . , p−1 2 } in two nonzero parts. Here we have presented two proposals, but it would surely be interesting to analyze also other options different from ours.
Both of the constructions in Definitions 11 and 12 produce a sequence of partial quotients b 0 , b 1 , . . . ∈ Q p such that, for all n ∈ N, We are going to see that also the additional condition required by Theorem 9, i.e.
is satisfied for both algorithm.

Proposition 14
Let α ∈ Q p . Then the partial quotients generated by the new algorithms in Definitions 11 and 12 satisfy the conditions of Theorem 9.
Proof To prove the claim, we are left to show that v p (b 3n+2 b 3n+3 + 1) = 0, for all n ∈ N.
We prove it only for the second algorithm, the other proof is similar. First we notice that, by construction, Let us show that the case v p (b 3n+2 b 3n+3 + 1) > 0 can not occur. For all n ∈ N, is not fulfilled. However, this would imply that a 0 ≡ 0 mod p, but this cannot happen, due to the constraints in the algorithm when using the function t.
Finally we prove that the second new algorithm succeed in obtaining the finiteness of the expansion for rational numbers, as it happens for Browkin I and Browkin II. We state it in the following theorem.

Theorem 15 If α ∈ Q, then the second new algorithm (Definition 12) stops in a finite number of steps.
Proof Let us consider α ∈ Q. We are going to show that the algorithm from Definition 12 stops in a finite number of steps when the input is α. By construction we have, v p (α 3k+1 ) < 0, v p (α 3k+2 ) = v p (α 3k+3 ) = 0, so that we can write Let us notice that for this algorithm, for all n ∈ N, the partial quotients are such that The partial quotients b 3n+1 are generated by the function t and it has been shown in [1] that We have that 2p l+1 − p + 1 < 2p 2l , since p 2l ≥ p l for every l ≥ 1 and consequently we also have p l+1 + p l − p + 1 < 2p 2l . Thus, we obtain, for all k ∈ N, that Since the sequence {|N 3n |+|D 3n |} n∈N is a strictly decreasing sequence of natural numbers it must be finite and hence α has a finite continued fraction.
We conclude this section with an example of the continued fraction expansion of a rational number obtained using this algorithm.
Example 16 Let us consider p = 7 and let us compute the continued fraction of α 0 = − 1 5 ∈ Q 7 . Its expansion is so that b 0 = s(α 0 ) = −3 and Then the second partial quotient is b 1 = t(α 1 ) = − 1 7 and the following complete quotient is Using the third function we get b 2 = u(α 2 ) = 1 and then Hence, the finite continued fraction for − 1 5 ∈ Q 7 using the algorithm of Definition 12 is

Generalization to n steps
The aim of this section is to generalize Theorem 9 to a generic n-step algorithm. On this purpose, we also need several additional conditions on the valuations, thus we introduce the following notation for a family of sequences. Let n, m ∈ N, with m ≥ 2, we define the family of sequences U (n) m as

Lemma 17
For every n ≥ 2, the partial denominators B n can be obtained as: Proof Let us prove the claim by induction on n. For n = 2 and n = 3 it holds since: Now let us suppose that the claim holds at the steps n and n + 1, that is: We are going to show that it is true also for B n+2 . In fact: It follows that the thesis is true for all n ≥ 2.

Remark 18
Notice that Lemma 17 holds also starting from a generic step k. It means that for all k ∈ N and n ≥ 2, and the proof is similar to the case k = 0 seen in Lemma 17.

Theorem 19
Let us consider r ∈ N + and b 0 , b 1 , . . . ∈ Q p such that, for all n ∈ N: . Moreover let us suppose that, for all n ∈ N, Then we have, for all n ∈ N, Proof Let us prove the claim by induction on n.

Base step
We prove the thesis for n = 0. The valuation of the first denominator is: At the following step, since v p (b r+1 ) < 0, we get: Hence, the claim is true for n = 0.

Induction step
Let us suppose that the thesis holds for a generic n ∈ N, that is: We want to prove the claim for n + 1.
The induction is then complete and the claim holds for all n ∈ N. By Theorem 19 we have that, for all n ∈ N, v p (B rn+1 B rn+2 ) = · · · = v p (B rn+r−1 B rn+r ) > v p (B rn+r B rn+r+1 ), so that the sequence v p (B n B n+1 ) is decreasing and divergent to −∞.
By Corollary 20, we obtain the convergence of a p-adic continued fractions algorithm generating the partial quotients as With a construction similar to the one made in Example 4, it can be proved that the conditions of Theorem 19 are necessary for the p-adic convergence.

Conclusions
In this paper we have analyzed the convergence of p-adic continued fractions in order to give a better understanding for the design of an algorithm that enjoys some properties similar to those holding for classical continued fractions in R. At the present moment such an algorithm does not exist, because an analogue of Lagrange's Theorem has not been proved yet. In Theorem 7, we have characterized the strict decrease of the valuations v p (B n B n+1 ), used by Browkin in [4] and [5]. This characterization guarantees the p-adic convergence of all the algorithms generating partial quotients such that v p (b n ) + v p (b n+1 ) < 0 for all n ∈ N. Outside from this hypothesis, we have also obtained some effective conditions for the convergence of a p-adic continued fractions with only one negative partial quotient each r steps. In particular, Browkin's continued fractions in [4] and [5] are respectively the cases when r = 1 and r = 2. For the case r = 3 we have proposed some actual algorithms, proving that one of them terminates in a finite number of steps when processing a rational number.
Funding Open access funding provided by Università degli Studi di Trento within the CRUI-CARE Agreement.
Data availability Data sharing not applicable to this article as no datasets were generated or analysed during the current study.