aa r X i v : . [ m a t h . N T ] A p r The Sum of Squares function in the ring Z p k Rob Burns23rd April 2020
Abstract
We calculate the general sum of squares function r m in the ring Z p where p is an odd prime and the sum of two and three squares functions r and r inthe ring Z p k for k ≥ The representation of elements of a ring as a sum of squares (or more generally as asum of powers) is a very large and old subject. In the following we attempt to givea flavour of the type of questions that have been studied. It is not intended as acomplete survey.Restricting ourselves to the integers for the moment, Fermat proved that every integeris either a square or a sum of 2, 3, or 4 squares. Fermat also discovered that an oddprime p can be expressed as the sum of 2 squares if and only if p ≡ k + 3 occurs as an even power ([29]).Diophantus, Bachet, Fermat, Descartes and Lagrange amongst others worked on therepresentation of integers as the sum of three or more squares. Legendre proved inhis Essai sur la theorie des nombres (1798) that a positive integer can be written asa sum of three squares if and only if it is not of the form 4 x (8 y + 7) for nonnegativeintegers x and y .In 1770, prior to Legendre’s result, Lagrange had proved that every positive integercan be written as the sum of at most four squares. This is known as Lagrange’sfour-square theorem or Bachet’s conjecture ([17]).The asymptotic density of the positive integers which are the sum of two squares iszero. Landau showed that the asymptotic density of the positive integers which are1he sum of three squares is ([20]).Moving away from the integers, we find that the representation of elements as a sumof squares has been studied in many other rings.In Hilbert’s book Foundations of Geometry (1899), he stated without proof that a to-tally positive element of any number field can be expressed as a sum of four squares inthe field. Landau proved this for quadratic number fields in 1919 and Siegel extendedthe proof to all number fields in 1921 ([28]). The situation is less straightforwardwhen considering elements from the ring of integers rather than general elements inthe number field. For example, in the field Q ( i ), which has Z ( i ) as its ring of integers,the element i cannot be expressed as a sum of squares of elements from Z ( i ).In 1940 Niven [24] investigated imaginary quadratic number fields K = Q ( √− m )where m is a square-free positive integer. If Z K is the ring of integers of K , Nivenshowed that every element in Z K can be expressed as a sum of three squares ofelements from Z K if m ≡ m ≡ x + y √− m in Z K is a sum of three squares if and only if y is an eveninteger.Results for specific real quadratic number fields are known. For example, Fritz Gotzkyshowed in [13] that every totally positive integer in K = Q ( √
5) can be representedas a sum of four squares of integers in K . Harvey Cohn considered K = Q ( √
2) in[7] and proved that a totally positive integer a = x + y √ K if and only if y is even. He in fact provided a formulafor the number of ways such an element a could be written as a sum of four integralsquares in K . He also established a partial result for Q ( √ F = Q ( √
35) and where p is a prime satisfying (cid:0) p (cid:1) = 1, then no numberof the form 7 p is a sum of three integral squares in F, even though 7 is a sum ofthree integral squares locally everywhere.In [8], Colliot-Th´el´ene and Xu consider the connection between the representationof integral elements as a sum of squares and the Brauer-Manin obstruction. Anappendix to the paper provides an example of the local-global principle in the settingof cyclotomic fields. The authors prove that an element x in the ring of integers O ofa cyclotomic field is a sum of three squares of integers in O if and only if x is a sumof three squares in all local completions O v of O .Hilbert’s seventeenth problem asks whether every real positive definite polynomial,i.e., one which takes positive values only, can be expressed as a sum of squares ofpolynomials or, if not, whether it can be expressed as a sum of squares of ratio-nal functions. There are examples of real positive definite polynomials, such as the2otzkin polynomial ( x + y − z ) x y + z , which cannot be expressed as a sum ofsquares of polynomials. In 1927, Artin [2] showed that such polynomials can alwaysbe expressed as a sum of squares of rational functions. Leep and Starr [21] providedexamples of positive semidefinite polynomials in two variables which are sums of threerational squares, but not sums of polynomial squares.The paper by Choi, Lam, Reznick and Rosenberg [5] discusses the connection betweenrepresenting an element a in an integral domain A as a sum of n squares from thefraction field of A and representing a as a sum of m ≥ n squares in A itself. Theauthors prove that the former condition implies the latter for certain unique factori-sation domains, regular semilocal domains and positive semidefinite polynomials in apolynomial ring over the reals.The above questions can also be asked about matrix elements over a ring. In a 1968paper, Carlitz [4] proved that every two-by-two matrix over Z is a sum of a threesquares. Griffin and Krusemeyer [14] give some circumstances under which a matrixis a sum of two squares. Newman [23] treated the case of n × n matrices over Z and Z and found the minimum number of squares needed to represent such matrices. Morerecently Katre and Garge [19] examined M n ( R ), the n × n matrices over R , where R is a commutative, associative ring with unity. They provided trace conditions on amatrix in M n ( R ) which ensures it is a sum of k -th powers of matrices.Hilbert’s seventeenth problem can be extended to matrices. Gondard and Ribenboim[9] and Procesi and Schacher [26] independently proved that matrices with positivesemidefinite polynomial function entries can be expressed as a sum of squares ofsymmetric matrices with rational function entries.In a general setting, Fernando, Ruiz and Scheiderer [12] showed that certain excellentrings contain positive semidefinite elements which are not sums of squares.We finally turn to the ring Z n of integers modulo n . Harrington, Jones and Lamarche[16] determined the values of n for which every element of Z n can be written as asum of two squares. For a prime p and positive integer k , Burns [3] determined whichelements of Z p k can be written as a sum of two squares in the ring and then againdetermined the values of n for which all elements of Z n are a sum of two squares.In [1] Arias, Borja and Rubio counted the number of integers in Z n that are in theimage of various polynomials such as x + y and x + y + z .In the above contexts we also need to mention Waring’s Problem which asks for theleast positive integer g such that every element of a given ring is the sum of at most g squares (or higher powers) of elements from the ring. Waring’s problem has beenstudied on each of the rings mentioned above.We now introduce the sum of squares function r m which counts the number of waysan element of a ring can be written as a sum of m squares, allowing for zero as oneor more of the squares. Specifically, 3 m ( n ) = { ( x , x , ..., x m ) : m X i =1 x i = n } . Much is known about r m over the integers. Jacobi expressed r m ( n ) in terms of divisorfunctions when m = 2,4,6 and 8, For example, in [18] he proved that r ( n ) = 4( d ( n ) − d ( n ))where d ( n ) and d ( n ) are the number of divisors of n congruent to 1 (mod 4) and3 (mod 4), respectively. Expressions for r m ( n ) are also known for other values of m ,however some of these involve terms that are not explicitly given, as they appear onlyas coefficients of modular functions. Milne [22] and Ono [25] established formulas for r s and r s +4 s for every s ≥
1. Asymptotic expressions are also known for r m ( n ).The function r is connected to the Gauss circle problem through the summationfunction R ( N ) = P n ≤ N r ( n ). The generating function for r m can be expressed interms of the Jacobi theta function: ∞ X n =0 r m ( n ) x n = θ m ( x ) . This paper considers the sum of squares function over the ring Z p k of integers modulo p k for odd primes p and k ≥
1. We will retain the function name r m for the numberof ways of expressing an element of Z p k as a sum of m squares. The function nameshould include a subscript for p and k but hopefully the values of these integers willbe clear from each context.We start with results for the ring Z p . When t ∈ Z p the value of r m ( t ) dependson p (mod 4), m (mod 2) and (cid:0) tp (cid:1) . For clarity, we have divided the result into fourparts. Theorem 1.1. If p is an odd prime with p = 1 (mod 4) and m ≥ , then in Z p , r m +1 ( t ) = p m , if t = 0 p m − p m if t is a non-residue (mod p ) p m + p m if t is a residue (mod p ) . Theorem 1.2. If p is an odd prime with p = 1 (mod 4) and m ≥ , then in Z p , r m ( t ) = ( p m − + p m − p m − , if t = 0 p m − − p m − if t = 0 . heorem 1.3. If p is an odd prime with p = 3 (mod 4) and m ≥ , then in Z p r m +1 ( t ) = p m , if t = 0 p m + ( − m +1 p m if t is a non-residue (mod p ) p m + ( − m p m if t is a residue (mod p ) . Theorem 1.4. If p is an odd prime with p = 3 (mod 4) and m ≥ , then in Z p r m ( t ) = ( p m − + ( − m p m + ( − m − p m − , if t = 0 p m − + ( − m − p m − if t = 0 . If we restrict ourselves to the sum of two squares in the ring Z p k we have the follow-ing: Theorem 1.5.
Let p be an odd prime with p = 1 (mod 4) and let k ≥ . Let t ∈ Z p k and write t = p α β where p ∤ β . Then in Z p k r ( t ) = ( p k − ( p ( k + 1) − k ) , if t = 0( α + 1)( p − p k − if t = 0 Theorem 1.6.
Let p be an odd prime with p = 3 (mod 4) and let k ≥ . Let t ∈ Z p k and write t = p α β where p ∤ β . Then in Z p k r ( t ) = p ⌊ k ⌋ , if t = 0( p + 1) p k − if α is even if α is odd For the sum of three squares in the ring Z p k we have: Theorem 1.7.
Let p be an odd prime with p = 1 (mod 4) and let k ≥ . Let t ∈ Z p k and write t = p α β where p ∤ β . Then in Z p k r ( t ) = p k + p k − − p ⌈ k ⌉− , if t = 0( p k − − p k − α +32 )( p + 1) if α is odd p k − ( p + 1) if α is even and (cid:0) βp (cid:1) = 1 p k − ( p + 1) − p k − − α if α is even and (cid:0) βp (cid:1) = − . heorem 1.8. Let p be an odd prime with p = 3 (mod 4) and let k ≥ . Let t ∈ Z p k and write t = p α β where p ∤ β . Then in Z p k , r ( t ) = p k + p k − − p ⌈ k ⌉− , if t = 0( p k − − p k − α +32 )( p + 1) if α is odd p k − ( p + 1) − p k − − α if α is even and (cid:0) βp (cid:1) = 1 p k − ( p + 1) if α is even and (cid:0) βp (cid:1) = − . Throughout this paper we will assume that p is an odd prime. We will be using theLegendre symbol (cid:0) tp (cid:1) modulo p . The floor of the real number x is written ⌊ x ⌋ anddefined as the largest integer ≤ x . The ceiling of the real number x is written ⌈ x ⌉ anddefined as the smallest integer ≥ x . If A is a set, we denote the number of elementsin A by A .When discussing divisibility of an integer x by a prime p , we will use the notation p n k x to mean that n is the highest power of p dividing x , i.e. p n | x and p n +1 ∤ x .We will also use the notation ord p ( x ) = n to mean that n is the highest power of p dividing x .Our first observation is that in Z p the value of r m ( t ) depends only on (cid:0) tp (cid:1) . Lemma 2.1.
Let m ≥ and suppose s, t ∈ Z p with (cid:0) sp (cid:1) = (cid:0) tp (cid:1) . Then r m ( s ) = r m ( t ) .Proof. If (cid:0) sp (cid:1) = (cid:0) tp (cid:1) then t/s is a quadratic residue (mod p ). Let z = p t/s in Z p .Then m X i =1 ( x i ) = s ⇐⇒ m X i =1 ( x i ∗ z ) = t. According to the lemma above, all information in Z p about the function r m is con-tained in a 3 × γ m and define by γ m := r m (0) r m ( s ) r m ( t ) where s is any non-residue and t is any residue (mod p ). We denote the componentsof γ m by γ m, , γ m, and γ m, . 6 The Z p case: proof of theorems 1.1 - 1.4 In this section we will prove the four theorems 1.1, 1.2, 1.3 and 1.4 related to Z p . Wefirst prove the theorems for r and r and then establish a recurrence relation whichcan be used to derive the general formulae. It is easy to see that γ = (1)which establishes theorems 1.1 and 1.3 for r .We include the proof of the case m = 2 here even though it is available elsewhere. Itrequires a few lemmata. Lemma 3.1.
For each non-zero t ∈ Z p the congruence y = x + t (mod p ) has p − solutions ( x, y ) .Proof. Rearranging we have y − x = t (mod p ). Factorising the LHS and changingvariables to u = y − x , v = y + x , which is an invertible map in Z p , we have uv = t (mod p ). For each non-zero choice for u (mod p ) there is a unique value for v = t ∗ u − (mod p ) which satisfies the congruence. There are therefore p − u, v )and the number of solutions of the original congruence in terms of the variables ( x, y )is the same as the number of solutions for ( u, v ). Lemma 3.2.
For fixed non-zero t ∈ Z p , P p − x =0 (cid:0) x + tp (cid:1) = − .Proof. On the one hand the lemma 3.1 says the number of solutions to the congruence y = x + t (mod p ) is p −
1. On the other hand for each fixed x the number of y satisfying y = x + t (mod p ) is 1 + (cid:0) x + tp (cid:1) . Summing this number over the p x -valuesand equating the result to p − Corollary 3.3.
The number of ( x, y ) solutions to the congruence x + y = 0 (mod p ) is ( p − , if p = 1 (mod 4)1 if p = 3 (mod 4) . For each non-zero t ∈ Z p , the number of ( x, y ) solutions to the congruence x + y = t (mod p ) is ( p − , if p = 1 (mod 4) p + 1 if p = 3 (mod 4) . roof. Firstly, − p ) ⇐⇒ p = 1 (mod 4). Therefore, x = − y has no solution if p = 3 (mod 4) other than (0 ,
0) and has 2( p −
1) + 1 = 2 p − p = 1 (mod 4). Next, if t = 0, the number of ( x, y ) satisfying x + y = t (mod p ) is p − X x =0 (1 + (cid:18) t − x p (cid:19) )= p + p − X x =0 (cid:18) t − x p (cid:19) = p + (cid:18) − p (cid:19) p − X x =0 (cid:18) x − tp (cid:19) . The corollary follows from Lemma 3.2.In terms of the vector γ , Corollary 3.3 says that when p = 1 (mod 4), γ = p − p − p − (2)and when p = 3 (mod 4), γ = p + 1 p + 1 . (3)This establishes theorems 1.2 and 1.4 for r .In order to establish a recursive formula for the vector γ m in terms of γ m − we needtwo preliminary results.When t is a non-residue mod p we have: Lemma 3.4.
Suppose (cid:0) tp (cid:1) = − . Then n z : (cid:18) t − z p (cid:19) = − o = ( p +12 , if p = 1 (mod 4) p − if p = 3 (mod 4) and n z : (cid:18) t − z p (cid:19) = 1 o = ( p − , if p = 1 (mod 4) p +12 if p = 3 (mod 4)8 roof. Since t is a non-residue, t − z = 0 (mod p ) for all z . From Corollary 3.3, theequation x + z = t has p − x, z ) if p = 1 (mod 4) and p + 1 solutions( x, z ) if p = 3 (mod 4). Therefore, t − z is a quadratic residue (mod p ) for p − values of z if p = 1 (mod 4) and for p +12 values of z if p = 3 (mod 4). Since t − z = 0(mod p ), t − z is a non-quadratic residue (mod p ) for the remaining values of z .When t is a residue mod p we have: Lemma 3.5.
Suppose (cid:0) tp (cid:1) = 1 . Then n z : (cid:18) t − z p (cid:19) = − o = ( p − , if p = 1 (mod 4) p − if p = 3 (mod 4) and n z : (cid:18) t − z p (cid:19) = 1 o = ( p − , if p = 1 (mod 4) p − if p = 3 (mod 4) Proof.
Since t is a residue, t − z = 0 (mod p ) when z = ±√ t . When p = 1 (mod 4),Corollary 3.3 says there are p − x, z ) to the congruence x + z = t andthese solutions can be written as:(0 , ±√ t ) , ( ±√ t, , ( x i , z i ) p − i =1 where the solutions are arranged so that z i − = z i for all i (i.e x i − = − x i ).Excluding the solutions (0 , ±√ t ) and including z = 0, we see that t − z is a quadraticresidue for 1 + p − = p − values of z when p = 1 (mod 4). A similar argument canbe used when p = 3 (mod 4).Let t ∈ Z p . By writing the congruence P m +1 i =1 x i = t as P mi =1 x i = t − x m +1 , wehave: r m +1 ( t ) = X s ∈ Z p n ( x i ) mi =1 : m X i =1 x i = s o × n x m +1 : t − x m +1 = s o = n ( x i ) mi =1 : m X i =1 x i = 0 o × n x m +1 : t − x m +1 = 0 o + n ( x i ) mi =1 : m X i =1 x i = s o × n x m +1 : (cid:18) t − x m +1 p (cid:19) = − o + n ( x i ) mi =1 : m X i =1 x i = s o × n x m +1 : (cid:18) t − x m +1 p (cid:19) = 1 o (4)9here s is a fixed non-residue (mod p ) and s is a fixed residue (mod p ) (theparticular choices do not matter due to Lemma 2.1). We can rewrite equation (4)as r m +1 ( t ) = γ m, × { x m +1 : t − x m +1 = 0 } + γ m, × { x m +1 : (cid:18) t − x m +1 p (cid:19) = − } + γ m, × { x m +1 : (cid:18) t − x m +1 p (cid:19) = 1 } . (5)By substituting in turn t = 0, t a non-residue and t a residue (mod p ) in equation(5), we obtain three linear equations for the components of γ m +1 in terms of the com-ponents of γ m . The resulting matrix equation can then be solved. Obviously, { x m +1 : − x m +1 = 0 } = 1and { x m +1 : (cid:0) − x m +1 p (cid:1) = ± } is either 0 or p − p (mod 4). Wecan obtain { x m +1 : (cid:0) t − x m +1 p (cid:1) = − } and { x m +1 : (cid:0) t − x m +1 p (cid:1) = 1 } from Lemma3.4 and Lemma 3.5. The resulting equations can be represented in matrix form as γ m +1 = A × γ m when p = 1 (mod 4), and γ m +1 = B × γ m when p = 3 (mod 4), wherethe matrices A and B are defined by: A := , , p − , p +12 , p − , p − , p − and B := , p − , , p − , p +12 , p − , p − . (6)Therefore, γ m = A m − × γ if p = 1 mod 4and γ m = B m − × γ if p = 3 mod 4 . Theorems 1.1 and 1.2 now follow from the form of γ and γ and the identities: A × p m p m − p m p m + p m = p m +2 p m +2 − p m +1 p m +2 + p m +1 for m ≥ ,A × p m − + p m − p m − p m − − p m − p m − − p m − = p m +1 + p m +1 − p m p m +1 − p m p m +1 − p m for m ≥ . B × p m p m + ( − m +1 p m p m + ( − m p m = p m +2 p m +2 + ( − m p m +1 p m +2 + ( − m +1 p m +1 for m ≥ , and B × p m − + ( − m p m + ( − m − p m − p m − + ( − m − p m − p m − + ( − m − p m − = p m +1 + ( − m +1 p m +1 + ( − m p m p m +1 + ( − m p m p m +1 + ( − m p m for m ≥ . r p = 1 (mod 4) We first deal with primes p : p = 1 (mod 4) and calculate r in Z p k where k ≥ (cid:0) − p (cid:1) = 1, √− Z p k by Hensel’s Lemma. We make the invertibletransformation: u = x + y √− , v = x − y √− . Then, for t ∈ Z p k : { ( x, y ) : x + y = t (mod p k ) } = { ( u, v ) : uv = t (mod p k ) } . Let t = 0. Then, uv = 0 if and only if u = 0 or v = 0 or there is an 0 ≤ α < k suchthat p α k u and p k − α | v . We have { u : p α k u } = p k − α − ( p −
1) and { v : p k − α | v } = p α − . So, { ( u, v ) : uv = 0 (mod p k ) } = 2 p k − k − X α =0 p k − α − ( p α − p − p k − ( p ( k + 1) − k ) . Next, assume p α k t and write t = p α β where 0 ≤ α < k and p ∤ β . Then, uv = t ifand only if u = p θ δ and v = p α − θ βδ − + np k − θ for some 0 ≤ θ ≤ α , 0 ≤ n < p k − θ and1 ≤ δ < p k − θ with p ∤ δ . Then, { ( u, v ) : uv = t } = α X θ =0 n δ ∈ Z p k : 1 ≤ δ < p k − θ and p ∤ δ o × p θ = α X θ =0 p k − θ − ( p − p θ = ( α + 1) ( p − p k − . This completes the proof of theorem 1.5. p = 3 (mod 4) In this section we assume p = 3 (mod 4) and determine r in Z p k where k ≥ r (0). When p = 3 (mod 4), there are no non-trivial solutions( x, y ) to x + y = 0 (mod p ). Therefore, ord p ( x + y ) = min { ord p ( x ) , ord p ( y ) } . (7)So if x + y = 0 (mod p k ), both x and y must be zero (mod p k ). We have, { x : x = 0 (mod p k ) } = { , p ⌈ k ⌉ , p ⌈ k ⌉ , . . . , ( p k −⌈ k ⌉ − p ⌈ k ⌉ } . Hence, { x : x = 0 (mod p k ) } = p k −⌈ k ⌉ = p ⌊ k ⌋ and the same result holds for y . Therefore, r (0) = p ⌊ k ⌋ .Next let t ∈ Z p k and assume p α +1 k t for some α : 1 ≤ α + 1 < k . Then x + y = t (mod p k ) from (7). Hence, r ( t ) = 0 in this case.Next assume p ∤ t . Any pair ( x, y ) satisfying x + y = t (mod p k ) is of the form x = x + mp k − , y = y + np k − where x + y = t (mod p k − ) and 0 ≤ m, n < p .Then x + y = t + rp k − for some r . Expanding the initial congruence we find that p must divide 2 x m +2 y n + r . Since p ∤ t , one of x or y (say x ) is not divisible by p andis thus invertible in Z p . If y = 0, then m = − r x (mod p ) and n = { , , . . . , p − } .12f y = 0, m = − r − y n x (mod p ). In either case, there are p choices for the pair ( m, n )producing a solution to the original congruence. Therefore, { ( x, y ) : x + y = t (mod p k ) } = p × { ( x, y ) : x + y = t (mod p k − ) } . From theorem 1.4, { ( x, y ) : x + y = t (mod p ) } = p + 1. So, when p ∤ t , { ( x, y ) : x + y = t (mod p k ) } = ( p + 1) p k − (8)We now assume p α k t for some α : 0 < α < k and write t = p α β where p ∤ β . If, x + y = t (mod p k ), then x + y = 0 (mod p ) and so x, y = 0 (mod p ). Putting x = px , y = py and dividing the congruence through by p we have x + y = p α − β (mod p k − ). Continuing in this way, we find m, n ∈ Z p k − α such that x = p α m , y = p α n and m + n = β (mod p k − α ). From (8) there are ( p + 1) p k − α − solutionsto the congruence a + b = β (mod p k − α ). Each of these solutions ( a, b ) generates p α values for m, n ∈ Z p k − α given by m ∈ { a, a + p k − α , . . . , a + ( p α − p k − α } ,n ∈ { b, b + p k − α , . . . , b + ( p α − p k − α } . The number of solutions to x + y = p α β (mod p k ) is( p + 1) p k − α − × p α × p α = ( p + 1) p k . This completes the proof of theorem 1.6. r In this section we will calculate r in Z p k where k ≥
1. We will use the results for r and the decomposition: r ( t ) = X s ∈ Z pk r ( s ) × n z : t − z = s o . (9)Let t = p α β ∈ Z p k where p ∤ β . The following lemmas give the number of z ∈ Z p k satisfying p γ k t − z for each γ : 0 ≤ γ < k . Lemma 5.1. n z : z = 0 (mod p k ) o = p ⌊ k/ ⌋ . roof. z = 0 if and only if z = 0 or z = sp ⌈ k/ ⌉ for some s : 1 ≤ s < p k −⌈ k/ ⌉ − Lemma 5.2. If t = 0 , n z : t − z = 0 (mod p k ) o = ( p α/ if α is even and (cid:0) βp (cid:1) = 10 otherwise . Proof. If (cid:0) tp (cid:1) = 1, √ t exists in Z p k . Then t − z = 0 (mod p k ) if and only if z = ±√ t + sp k − α/ for some s : 0 ≤ s < p α/ − Lemma 5.3. If α is odd and γ : 0 ≤ γ < k then n z : p γ k t − z (mod p k ) o = ( p − p k − − γ/ if γ is even and ≤ γ < αp k − ( α +1) / if γ = α otherwise . Proof. If z = 0 , p α k t − z . Suppose z = 0 with p δ k z . Then, p δ k t − z for 0 ≤ δ < α p α k t − z for α < δ < k. (10)The statement for γ even and less than α then follows from { z : p δ k z } = ( p − p k − − δ . The statement for γ = α follows from { z : p δ k z for α < δ < k } = k − X δ =( α +1) / ( p − p k − − δ = p k − ( α +1) / − . If γ is odd but not equal to α , it is clear from (10) that ord p ( t − z ) = γ . Lemma 5.4. If α is even, (cid:0) βp (cid:1) = − and γ : 0 ≤ γ < k then n z : p γ k t − z (mod p k ) o = ( p − p k − − γ/ if γ is even and ≤ γ < α if γ is odd p k − α/ if γ = α if α < γ < k. roof. If z = 0 , p α k t − z . Suppose z = 0 with z = p δ ǫ . Then, (10) holds and thestatement for γ even and less than α follows in the same way as for lemma 5.3. When δ = α/ t − z = p α ( β − ǫ ). As (cid:0) βp (cid:1) = − β − ǫ = 0 (mod p ) and so p α k t − z .Therefore, p α k t − z when α/ ≤ δ < k . The statement for the case γ = α followsfrom: { z : p δ k z for α ≤ δ < k } = k − X δ = α/ ( p − p k − − δ = p k − α/ − . If γ is odd or γ > α , it is clear from (10) that ord p ( t − z ) = γ . Lemma 5.5. If α is even, (cid:0) βp (cid:1) = 1 and γ : 0 ≤ γ < k then n z : p γ k t − z (mod p k ) o = ( p − p k − − γ/ if γ is even and ≤ γ < α if γ is odd and ≤ γ < α ( p − p k − − α/ if γ = α p − p k − α/ − γ if α < γ < k. Proof.
Suppose z = 0 and write z = p δ ǫ with p ∤ ǫ and 1 ≤ ǫ < p k − δ .When γ is even and 0 ≤ γ < α , the calculation is the same as for lemmas 5.3 and 5.4above.If γ is odd and less than α , (10) shows there is no z with p γ k t − z .Now, p α k t − z if and only if z = 0 or p α/ | z or p α/ k z and p ∤ β − ǫ . We have: { z : p α/ | z } = p k − − α/ − { z : p α/ k z and p ∤ β − ǫ } = { ǫ : 1 ≤ ǫ < p k − α/ , p ∤ ǫ and p ∤ β − ǫ } = ( p − p k − − α/ − p k − − α/ since p | β − ǫ if and only if ǫ = ±√ β + np for some n with 0 ≤ n < p k − − α/ . Addingthe three components gives the result for γ = α .If γ > α , then p γ k t − z if and only if p α/ k z and p γ − α k β − ǫ . We have: { z : p α/ k z and p γ − α k β − ǫ } = { ǫ : 1 ≤ ǫ < p k − α/ , p ∤ ǫ, p γ − α k β − ǫ } = 2( p − p k − α/ − γ since p γ − α k β − ǫ if and only if ǫ = ±√ β + np γ − α where p ∤ n and 0 ≤ n < p k + α/ − γ .15 .2 Proof of theorem 1.7 and theorem 1.8 Let t ∈ Z p k with t = p α β . Proving theorems 1.7 and 1.8 requires a separate calculationfor each of the possibilities for t . The four possibilities for t are: t = 0, α odd, α evenand (cid:0) βp (cid:1) = 1 and α even and (cid:0) βp (cid:1) = −
1. In addition we need to consider p (mod 4).We provide the calculations for a few of the eight possible cases. The calculations forthe other cases follow the same pattern. p = 1 (mod 4) and t = 0When t = 0, equation (9) becomes: r (0) = X s ∈ Z pk r ( s ) × n z : − z = s o . (11)Writing each s (other than s = 0) in the sum in equation (11) as s = p γ b where p ∤ b ,we can use theorem 1.5 and lemma 5.2, to get: r (0) = p k − ( p ( k + 1) − k ) ∗ p ⌊ k/ ⌋ + X γ even X b : ( bp ) = − ( γ + 1)( p − p k − ∗ p γ/ . For fixed γ , { s : p γ k s and (cid:0) bp (cid:1) = − } = ( p − p k − γ − . Therefore, r (0) = p k − ( p ( k + 1) − k ) ∗ p ⌊ k/ ⌋ + ( p − p k − X γ even ( γ + 1) p k − γ/ − = p k − ( p ( k + 1) − k ) ∗ p ⌊ k/ ⌋ + ( p − p k − ⌊ ( k − / ⌋ X γ =0 (2 γ + 1) p k − γ − after reindexing. The two parts of the sum are evaluated as:( p − p k − ⌊ ( k − / ⌋ X γ =0 γp k − γ − = p k − − ⌊ k + 12 ⌋ p k −⌊ ( k +1) / ⌋ + ⌊ k − ⌋ p k − −⌊ ( k +1) / ⌋ and ( p − p k − ⌊ ( k − / ⌋ X γ =0 p k − γ − = p k − p k − − p k −⌊ ( k +1) / ⌋ + p k − −⌊ ( k +1) / ⌋ . Manipulating the f loor and ceiling functions produces the result for t = 0 in theo-rem 1.7. 16 .2.2 The case p = 3 (mod 4) and t = 0Now consider the case p = 3 (mod 4). Using theorem 1.6 and lemma 5.2: r (0) = p ⌊ k/ ⌋ ∗ p ⌊ k/ ⌋ + X s =0 r ( s ) ∗ p γ = p ⌊ k/ ⌋ + X s =0 ( p + 1) p k − ∗ p γ where the sums in the two lines above are over s : s = p γ b with 0 ≤ γ < k , p ∤ b , (cid:0) bp (cid:1) = − ≤ b < p k − γ . For fixed γ , the number of b satisfying the last threeconditions is p k − γ − ( p − r (0) = p ⌊ k/ ⌋ + ⌊ ( k − / ⌋ X γ =0 p k − γ − ( p − p + 1) p k − ∗ p γ = p ⌊ k/ ⌋ + ( p + 1) p k − ⌊ ( k − / ⌋ X γ =0 ( p − p k − γ − = p ⌊ k/ ⌋ + ( p + 1) p k − (cid:0) p k − p k − −⌊ ( k − / ⌋ (cid:1) = p k + p k − + p ⌊ k/ ⌋ − ( p + 1) p k − −⌊ ( k − / ⌋ . This is equivalent to the statement for t = 0 in theorem 1.8. p = 1 (mod 4) and α odd Theorem 1.5 shows that for s ∈ Z p k , r ( s ) depends only on ord p ( s ). We can use (9)and lemmas 5.2 and 5.3 in this case to get: r ( t ) = p k − ( p ( k + 1) − k ) × n z : t − z = 0 o + k − X γ =0 ( γ + 1)( p − p k − × n z : p γ k t − z o = ( α − / X γ =0 (2 γ + 1)( p − p k − × ( p − p k − − γ + ( α + 1)( p − p k − × p k − ( α +1) / where the sum has been reindexed to account for even γ . The two parts of the sumare evaluated as:2( p − p k − α − / X γ =0 γp − γ = 2 p k − − ( α + 1) p k − ( α +1) / + ( α − p k − ( α +3) / p − p k − α − / X γ =0 p − γ = ( p − p k − − p k − ( α +3) / ) . The formula in theorem 1.7 for the case when α is odd follows. p = 1 (mod 4) , α even and (cid:0) βp (cid:1) = 1We use (9), theorem 1.5, lemmas 5.2 and 5.5 in this case to get: r ( t ) = Σ + Σ + Σ + Σ where, Σ is the contribution to r ( t ) in (9) from s = 0, Σ is the contribution from s such that 0 ≤ ord p ( s ) < α , Σ comes from ord p ( s ) = α and Σ comes from s with α < ord p ( s ) < k . So, Σ = p k − (cid:16) p ( k + 1) − k (cid:17) × p α/ . After re-indexing for even γ in Σ ,Σ = ( p − p k − α/ − X γ =0 (2 γ + 1)( p − p k − − γ = p k + p k − − ( α + 1) p k − α/ + ( α − p k − − α/ . We also have: Σ = ( p − p − α + 1) p k − − α/ and Σ = 2( p − p k − k − X γ = α +1 ( γ + 1) p k − α/ − γ = 2( α + 2) p k − − α/ − k + 1) p k + α/ + 2 kp k − α/ − α + 1) p k − − α/ . Adding up the various terms gives the formula for r ( t ) in theorem 1.7 when α is evenand (cid:0) βp (cid:1) = 1. 18 eferences [1] Fabi´an Arias, Jerson Borja, and Luis Rubio. Counting integers representable as imagesof polynomials modulo n . arXiv , arXiv:1812.11599, 12 2018. 3[2] Emil Artin. ¨Uber die Zerlegung definiter Funktionen in Quadrate. Abhandlungen ausdem Mathematischen Seminar der Universit¨at Hamburg , 5(1):100–115, Dec 1927. 3[3] Rob Burns. Representing numbers as the sum of squares and powers in the ring Z n . arXiv , arXiv:1708.03930, 08 2017. 3[4] L. Carlitz. Solution to problem 140 (proposed by I. Connell). Canad. Math. Bull. ,11:615–619, 1968. 3[5] M.D. Choi, T.Y. Lam, B. Reznick, and A. Rosenberg. Sums of squares in some integraldomains.
Journal of Algebra , 65(1):234 – 256, 1980. 3[6] James W. Cogdell. On sums of three squares.
Journal de Th´eorie des Nombres deBordeaux , 15(1):33–44, 2003. 2[7] Harvey Cohn. Decomposition into Four Integral Squares in the Fields of √ √ American Journal of Mathematics , 82(2), 1960. 2[8] Jean-Louis Colliot-Th´el`ene and Fei Xu. Brauer-Manin obstruction for integral pointsof homogeneous spaces and representation by integral quadratic forms.
CompositioMathematica , 145:309–363, 2009. 2[9] P. Ribenboim D. Gondard. Le 17e problme de Hilbert pour les matrices.
Bull. Sci.Math. , 98:49–56, 1974. 3[10] Leonard Euler. De numerus qui sunt aggregata quorum quadratorum.
Novi commen-tarii academiae scientiarum Petropolitanae , 4:3–40, 1752-1753. 1[11] Leonard Euler. Demonstratio theorematis Fermatiani omnem numerum primum for-mae 4n+1 esse summam duorum quadratorum.
Novi commentarii academiae scien-tiarum Petropolitanae , 5:3–13, 1754-1755. 1[12] Jos´e F. Fernando, Jes´us M. Ruiz, and Claus Scheiderer. Sums of squares in real rings.
Transactions of the American Mathematical Society , 356(7):2663–2684, 2004. 3[13] Fritz G¨otzky. ¨Uber eine zahlentheoretische Anwendung von Modulfunktionen zweierVer¨anderlichen.
Mathematische Annalen , 100:411–437, 1928. 2[14] Malcolm Griffin and Mark Krusemeyar. Matrices as sums of squares.
Linear andMultilinear Algebra , 5(1):33–44, 1977. 3[15] Hardy, G H and Wright, E M.
An introduction to the theory of numbers . OxfordUniversity Press, 5th edition, 1979. 1[16] J Harrington, L Jones, and A Lamarche. Representing integers as the sum of twosquares in the ring Z n . Journal of Integer Sequences , 17(14.7.4), 2014. 3
17] Kenneth Ireland and Michael Rosen.
A Classical Introduction to Modern NumberTheory . Springer New York, 1990. 1[18] Carl Gustav Jacob Jacobi.
Fundamenta nova theoriae functionum ellipticarum . Born-traeger, K´’onigsberg, 1829. 4[19] S. A. Katre and Anuradha S. Garge. Matrices over commutative rings as sums of k -thpowers. Proceedings of the American Mathematical Society , 141(1):103–113, May 2012.3[20] Edmund Landau. ¨Uber die Einteilung der positiven ganzen Zahlen in vier Klassen nachder Mindestzahl der zu ihrer additiven Zusammensetzung erforderlichen Quadrate.
Arch. Math. Phys. , 13:304–312, 1908. 2[21] David B. Leep and Colin L. Starr. Polynomials in R [ x, y ] that are sums of squares in R ( x, y ). Proceedings of the American Mathematical Society , 129(11):3133–3141, 2001.3[22] Stephen C. Milne. New Infinite Families of Exact Sums of Squares Formulas, Jacobi El-liptic Functions, and Ramanujan’s Tau Function.
Proceedings of the National Academyof Sciences of the United States of America , 93(26):15004–15008, 1996. 4[23] Morris Newman. Sums of squares of matrices.
Pacific J. Math. , 118(2):497–506, 1985.3[24] Ivan Niven. Integers of quadratic fields as sums of squares.
Trans. Amer. Math. Soc. ,48:405–417, 1940. 2[25] Ken Ono. Representations of integers as sums of squares.
Journal of Number Theory ,95:253–258, 2002. 4[26] Claudio Procesi and Murray Schacher. A non-commutative real Nullstellensatz andHilbert’s 17th problem.
Annals of Mathematics , 104(3):395–406, 1976. 3[27] Rainer Schulze-Pillot. Representation by integral quadratic forms - a survey. 2004. 2[28] Carl Siegel. Darstellung total positiver Zahlen durch Quadrate.
MathematischeZeitschrift , 11(3-4):246–275, Sep 1921. 2[29] Jeff Suzuki. Euler and Number Theory: A Study in Mathematical Invention. InRobert E. Bradley and C. Edward Sandifer, editors,
Leonhard Euler: Life, Work andLegacy , volume 5 of
Studies in the History and Philosophy of Mathematics , pages 363– 383. Elsevier, 2007. 1, pages 363– 383. Elsevier, 2007. 1