Periodicity of p-adic Expansion of Rational Number

In this paper we give an algorithm to calculate the coefficients of the p-adic expansion of a rational numbers, and we give a method to decide whether this expansion is periodic or ultimately periodic.


Introduction
It is known that in R, an element is rational if and only if its decimal expansion is ultimately periodic.An important analogous theorem for the p-adic expansion of rational number, is given by the following statement (see [1]): Theorem 1.1.The number x ∈ Q p is rational if and only if the sequence of digits of its p-adic expansion is periodic or ultimately periodic.

Definitions and properties
We will recall some definitions and basic facts from p-adic numbers (see [4].Throughout this paper p is a prime number, Q is the field of rational numbers, Q + is the field of nonnegative rational numbers and R is the field of real numbers.We use |.| to denote the ordinary absolute value, v p the p-adic valuation and |.| p the p-adic absolute value.The field of p-adic numbers Q p is the completion of Q with respect to the p-adic absolute value.We denote the ring of p-adic integers by Z p .Every element of Q p can be expressed uniquely by the p-adic expansion +∞ n=−j α n p n with α i ∈ {0, 1, .., p − 1} for i ≥ −j.In Z p we have simply j = 0. Now, we give in the following definition the requested algorithm for a rational number We define the sequences (α i ) i∈N and (β i ) i∈N by ...
For the second part, we suppose c d = +∞ i=0 α i p i , and we prove by recursion that the sequences (α i ) i∈N and (β i ) i∈N verified the algorithm (2.1).For i = 0, we have , so we have Under the hypothesis of the definition (2.1), we have Proof.We prove this lemma, also, by induction.For i = 1, it's obvious.
Suppose that, the relationship is true for i.From (2.1), we have So, the relationship is true for all i ∈ N. α n p n .We define a sequence (β i ) i∈N by the same way

Results and proof
To show that the algorithm (2.1) stops after a certain rank, it suffices to prove that the sequence (|β n |) n∈N is bounded or decreasing.This is the subject of the main theorem.
Main Theorem 3.1.The sequence (β i ) i∈N given in (2.1) verified the following cases: If c > d and p ≥ 3, we have, also, two cases: 2dp , then for a fixed integer Proof.We treat all cases: Case1.Let c < d, we use the proof by induction.For i = 0 is trivial.We suppose that in the rank n we have |β i | < d, and we prove the inequality |β i+1 | < d .Indeed, we have Case2.For c > d and p ≥ 3, we prove the two following cases: Case2.1.We suppose 0 < c(p−1) 2dp < 1.Also, we prove by recurrence that Now, we assume that the property is true at rank i, and we show it at rank i + 1.Indeed, we have Case2.2.Let the integer m given in (3.1), we suppose that 1 < c(p − 1) 2dp .
Firstly, we will prove that for all 0 ≤ i ≤ m the terms β i are strictly positive.Indeed, we assume that there is k ∈ {1, ..., m}, such that β k < 0. From definition (2.1), we have which means β k−1 < dp.Multiplying both sides by p k−1 , and applying the lemma The coefficients α n are strictly less than p, so c < dp Then, after simplification Where does the contradiction come from.Which means that for every 0 ≤ i ≤ m, we have β k > 0. Now, we prove the inequalities d ≤ β i ≤ c for i ∈ {0, ..., m}.
The inequality in law is easily proved by recurrence for all 0 ≤ i ≤ m.To prove the inequality in the left, we use the absurd.We assume that, there is a positive integer k ∈ {1, ..., m} such that 0 < β k < d (the condition d < c implies that k = 0).By lemma (2.3) we obtain For the second part of this case, we suppose there is a positive integer k > m + 1 3), we have For the second inequality, we have by the formula (2.1) For p = 3, c = 17 and d = 5, we have m = 0 and the case 2.2 is verified (see table 3) For p = 3, c = 124 and d = 7, we have m = 1 and the case 2.2 is verified (see table 4) For p = 3, c = 247 and d = 7, we have m = 2 and the case 2.2 is verified (see table 5) Proof.The proof is similar to that of the main theorem.

Table 1
which is another contradiction.So, for all i ≥ m + 2 we have |β i | ≤ d.The last part is easly.Example 3.2.For p = 3, c = 7 and d = 11, the case 1 is verified (see table 1)