Math 416, Modern II Monday, April 25, 2016 Note on p-adic Expansions in Q Here we tie up some loose ends concerning how p-adic expansions of (ordinary) and rationals look inside of Qp. In what follows, we let N denote the positive integers and let p ∈ N denote an arbitrary prime. Let us also call a (an)n∈N periodic if and only if there exists an s∈N with an = an+s for all n ∈ N. The least (positive) such s is called the period of (an)n∈N. We call (an)n∈N eventually periodic (or ultimately periodic) if and only if there exists a k ∈N with (an+k)n∈N periodic. If k is the minimal nonnegative with this property then we call (a1,...,ak−1) the pre-period, and (ak,ak+1,...) the periodic part, of (an)n∈N. Finally, abusing notation slightly, for any p-adic ∞ n rational x = n=j anp , we call the sequence (aj,aj+1,...) the digits of the p-adic expansion of x. We also say that x has a finite p-adic expansion if and only if an =0 for sufficiently large n. P From basic arithmetic, we know that positive integers always admit finite base-b expansions for N any b ∈ N. So it is easily checked that x ∈ Qp has a finite p-adic expansion if and only if x = pk for some k,N ∈N∪{0}. So let us now observe that negative integers have rather distinctive (non-finite) p-adic expansions. (Thanks to Nathan Melhop for pointing this fact out in class!) Lemma 1 The periodic part of the digits of the p-adic expansion of any negative integer x is (p − 1,p − 1,...).

p−1 Proof: First observe that −1 = 1−p , and the latter admits a convergent power ∞ n expansion in Zp: (p − 1) n=0 p . So the lemma certainly holds for x=−1. So assume x ∈ Z satisfies x ≤−2. Clearly, the positive integer −x − 1 admits a finite p-adic Pk−1 ∞ n expansion a0 + ··· + ak−1p , with k =1+ logp −x . Then x= x +1 − 1=x +1+ n=0(p − 1)p , and the latter is simply   P k−1 ∞ −(−x − 1) + (p − 1)pn + (p − 1)pn n=0 ! n=k k−1 Xk−1 X∞ n n n anp + (p − 1)p + (p − 1)p n=0 ! n=0 ! n=k X X X k−1 n Since |x +1|≤ n=0(p − 1)p , the sum of the first two terms is in fact a nonnegative integer, and thus has a finite p-adic expansion. So the periodic part of x is indeed as stated.  We next proveP a more general observation from class. Lemma 2 A p-adic rational number x lies in Q (i.e., is a of ordinary integers) if and only if the p-adic expansion of x is eventually periodic. Proof: (=⇒): The statement is clear for x∈Z, so let us assume x∈Q \ Z. Since multiplying x by M integer powers of p only shifts p-adic digits, we may also assume ordpx=0. So we may assume x= N with M,N ∈Z and gcd(M,p)=gcd(N,p)=1. Note then that the congruence pk =1 (mod N) has a solution k ∈{1,...,N − 1}, thanks to Euler’s Theorem. In particular, we can write pk =1 − vN for M vM vM some v ∈ Z. So then, x = N = vN = 1−pk , and we will soon see that k is a multiple of the period of expansion we seek. To continue, R:=vM and, if R=6 −1, let j be the least nonnegative integer such that pj >R. (If R = −1 then set j =0.) If R is a positive multiple of pk − 1 then set c = pk − 1. Otherwise, let k R k R−cpj c∈{0,...,p − 2} be the unique solution of c= pj (mod p − 1). Setting y := 1−pk we then see that j j−1 y is an integer in {0,...,p − 1}, with base-p expansion y0 + y1p + ··· + yj−1p . We also see that k j pj c R=(1 − p )y + p c, so that x=y + 1−pk . In particular, we obtain that the sequence of digits of the

Instructor: J. Maurice Rojas p-adic expansion of x is exactly (y0,...,yj−1,c0,...,ck−1,c0,...,ck−1,...), k−1 where c0 + c1p + ··· + ck−1p is the base-p expansion of c.  k−1 n ∞ n (⇐=): By assumption, we can write x in the form n=j anp + n=k anp , where j ≤k − 1, and k−1 n (ak,ak+1,...) is periodic with period s. In particular,P letting x0 :=P n=j anp , we obtain that x is the sum of the (ordinary) rational number, x0, and the number P ∞ k+si k+s−1+si z := ak+sip + ··· + ak+s−1+sip i=0 X ∞  k k+s−1 si = akp + ··· + ak+s−1p p i=0  X∞ k k+s−1 si = akp + ··· + ak+s−1p p i=0 k k+s−1  X a p + ··· + a + −1p = k k s , 1 − ps which is clearly rational. So we are done. 

2