1 Introduction
In 1770, Lagrange proved in [Reference Lagrange8] that any positive integer can be represented by a sum of at most four squares of integers. That is, for the quaternary quadratic form
$f(x,y,z,w)=x^2+y^2+z^2+w^2$
, the Diophantine equation
has an integer solution for any positive integer n. This famous theorem has been generalised in many directions. Ramanujan determined in [Reference Ramanujan11] that there are
$55$
positive definite integral diagonal quadratic forms which represent all nonnegative integers. Such a quadratic form is called universal. Dickson later pointed out in [Reference Dickson3] that the form
$x^2+2y^2+5z^2+5w^2$
, which represents all positive integers except for
$15$
, was incorrectly included, leaving only
$54$
. Recently, Conway and Schneeberger proved the so-called
$15$
-theorem, which says that any positive definite integral quadratic form representing
$1,2,3,5,6,7,10,14$
and
$15$
represents all nonnegative integers. Bhargava provided in [Reference Bhargava1] a simple and elegant method to prove the
$15$
-theorem.
In 1911, Dubouis determined in [Reference Dubouis4] all positive integers that are not represented by sums of k nonzero squares for any
$k \geq 4$
. Following this result, any positive integer is represented by k nonzero integers except for the integers in
$E_k$
, where
$$ \begin{align*} E_4&=\{1,2,3,5,6,8,9,11,14,17,29,41\} \cup \{2\cdot4^m, 6\cdot 4^m, 14\cdot 4^m \mid m \geq0\},\\ E_5&=\{1,2,3,4,6,7,9,10,12,15,18,33\} \end{align*} $$
and
for any
$k \geq 6$
. As a generalisation, Ji et al. determined in [Reference Ji, Kim and Oh5] all positive definite binary quadratic forms that are represented by sums of k nonvanishing squares for any integer
$k\ge 5$
. In [Reference Kim and Kim6], Kim and Kim extended the results of Dubouis to the real quadratic field
$\mathbb {Q}(\sqrt {m})$
, proving that for any integer
$k \geq 5$
, there exists a bound
$C(m,k)$
such that any totally positive integer in the real quadratic field
$\mathbb {Q}(\sqrt {m})$
whose norm exceeds
$C(m,k)$
can be represented as a sum of k nonzero integral squares in
$\mathbb {Q}(\sqrt {m})$
. In [Reference Kim and Oh7], Kim and Oh extended the results of Dubouis in another way. They determined
$S(p)$
for a prime p, where
$S(p)$
is the smallest number k such that any positive integer is a sum of at most k squares of integers that are not divisible by p.
In this article, we extend the result of Dubouis in a different direction. To explain our result, we introduce some useful notation. For any positive integer
$\rho $
, we define
For any positive integer n, we define
If
$\Sigma _\rho (n)$
is nonempty, we define
When
$\Sigma _\rho (n)$
is empty for given
$\rho $
and n, we define
$k_{\rho }(n)=\infty $
. We also define
The aim of this article is to determine
$M(\rho )$
for any positive integer
$\rho $
. More precisely, we prove that
$$ \begin{align*} M(\rho) = \begin{cases} 8 & \text{if } \rho=2,\\ 6 & \text{if } \rho=1, 3,\\ 5 & \text{if } \rho=5,\ 2^{m+1},\ 3\cdot2^m \text{ for some positive integer } m,\\ 4 & \text{otherwise.}\\ \end{cases} \end{align*} $$
Furthermore, we determine all positive integers
$\rho $
and n such that
$k_{\rho }(n) \ge 5$
.
2 Large integers that are sums of four squares of integers except for a fixed one
We show in Theorem 2.1 that for any positive integer
$\rho $
, any sufficiently large integer can be represented by a sum of at most four squares of integers in
$S_\rho $
. Also, by using Theorem 2.1, we determine the values of
$M(\rho )$
when
$1 \le \rho \le 5$
.
One may easily show that there are exactly
$12$
positive integers which are not a sum of squares of integers greater than
$1$
. In fact, they are
For any
$\rho \geq 2$
, since
$1 \in S_{\rho }$
and
$$ \begin{align*} n=\overbrace{1^2+1^2+\cdots+1^2}^{n \text{ times}}, \end{align*} $$
for any positive integer n, we have
$I(\rho )=\varnothing $
.
Theorem 2.1. Let
$\rho $
be any positive integer. Any integer n with
$n \geq 550\rho ^{2}$
is a sum of at most four squares of integers in
$S_{\rho }$
.
Proof. Let n be an integer satisfying the above inequality. First, suppose that
$n\equiv 2\ (\mathrm {mod}\ 4)$
. Choose a nonnegative integer m such that
Since
$n-4m^2\equiv 2\ (\mathrm {mod}\ 4)$
, it is represented by the ternary quadratic form
$x^2+y^2+z^2+(x+y+z)^2$
. So there are integers
$\alpha ,\beta ,\gamma $
and
$\delta $
such that
$$ \begin{align*}\begin{cases} \alpha^2+\beta^2+\gamma^2+\delta^2=n-4m^2,\\ \alpha+\beta+\gamma+\delta=0. \end{cases}\end{align*} $$
Therefore,
Note that
$n-4m^2<8m+4$
. Hence,
This implies that
$n=x^2+y^2+z^2+w^2$
has an integer solution
$(x,y,z,w)=(a,b,c,d)$
such that
Hence, if n is sufficiently large so that
$m-\sqrt {8m+4}>\rho $
, then all of
$a,b,c$
and d are greater than
$\rho $
. Note that
$m-\sqrt {8m+4}>\rho $
if and only if
$m>\rho +4+2\sqrt {2\rho +5}$
. Assume that an integer n satisfies
Since
we have
$m>\rho +4+2\sqrt {2\rho +5}$
. Therefore, if an integer n satisfies the condition (
$\ast $
), then we may find integers
$a,b,c$
and d such that
Since as a function of the variable
$\rho $
,
$$ \begin{align*} \frac{4(\rho+5+2\sqrt{2\rho+5})^2}{\rho^2} \end{align*} $$
is decreasing if
$\rho>0$
,
$$ \begin{align*} 550>4(6+2\sqrt7)^2 \ge \frac{4(\rho+5+2\sqrt{2\rho+5})^2}{\rho^2} \end{align*} $$
for any positive integer
$\rho $
. Therefore, any integer n with
$n \ge 550\rho ^2$
satisfies the condition (
$\ast $
).
Now, assume that
$n\equiv 1\ (\mathrm {mod}\ 2)$
. First, choose a nonnegative integer m such that
Consider the system of Diophantine equations
$$ \begin{align*}\begin{cases} p^2+q^2+r^2+s^2=n-(4m^2+2m),\\ p+q+r+s=1. \end{cases}\end{align*} $$
Since
$1<4(n-4m^2-2m)$
, we may apply Cauchy’s lemma in [Reference Cauchy2] (see also [Reference Nathanson9]) to obtain an integer solution
$(p,q,r,s)=(\alpha ,\beta ,\gamma ,\delta )$
to the above system of equations. Then,
$$ \begin{align*} n&=4m^2+2m+\alpha^2+\beta^2+\gamma^2+\delta^2\\&=(m+\alpha)^2+(m+\beta)^2+(m+\gamma)^2+(m+\delta)^2. \end{align*} $$
Note that
which implies that
Therefore, the equation
$n=x^2+y^2+z^2+w^2$
has an integer solution
$(x,y,z,w)=(a,b,c,d)$
such that
Hence, if n is sufficiently large so that
$m-\sqrt {8m+6}>\rho $
, then all of
$a,b,c$
and d are greater than
$\rho $
. Note that
$m-\sqrt {8m+6}>\rho $
if and only if
$m>\rho +4+\sqrt {8\rho +22}$
. Thus, for any integer n such that
$$ \begin{align} n&> 4(\rho+5+\sqrt{8\rho+22})^2+2(\rho+5+\sqrt{8\rho+22}) \nonumber\\ &=4\rho^2+74\rho+(8\rho+42)\sqrt{8\rho+22}+198, \end{align} $$
we may find integers
$a,b,c$
and d such that
Since as a function of the variable
$\rho $
,
$$ \begin{align*} \frac{4(\rho+5+\sqrt{8\rho+22})^2+2(\rho+5+\sqrt{8\rho+22})}{\rho^2} \end{align*} $$
is decreasing if
$\rho>0$
,
$$ \begin{align*} 550>4(6+\sqrt{30})^2+2(6+\sqrt{30})\geq \frac{4(\rho\!+\!5\!+\!\sqrt{8\rho+22})^2+2(\rho\!+\!5\!+\!\sqrt{8\rho+22})}{\rho^2} \end{align*} $$
for any positive integer
$\rho $
. Therefore, any integer n with
$n \ge 550\rho ^2$
satisfies the condition (
$\ast \ast $
).
Finally, assume that
$n\equiv 0\ (\mathrm {mod}\ 4)$
. Denote
$\rho =2^k\rho '$
, where
$k\geq 0$
and
$\rho '$
is an odd integer. Let
$n=4^el$
, where
$e\geq 1$
and
$l\not \equiv 0\ (\mathrm {mod}\ 4)$
. By Lagrange’s four square theorem, there are integers
$a,b,c$
and d such that
$l=a^2+b^2+c^2+d^2$
. Hence,
If
$e>k$
, then all of
$2^ea,2^eb,2^ec$
and
$2^ed$
are not equal to
$\rho $
.
Suppose that
$e \leq k$
. If
$l\ge 550(2^{k-e}\rho ')^2$
, then by the above arguments for any integer not divisible by
$4$
, we may find integers
$a',b',c'$
and
$d'$
such that
Hence, if
$n \ge 550\rho ^2$
, then
The theorem follows directly from this.
Theorem 2.2. Any integer which is a sum of squares of integers greater than
$1$
is a sum of at most six squares of integers greater than
$1$
and hence,
$M(1)=6$
.
Proof. By Theorem 2.1, any integer greater than or equal to
$550$
is a sum of at most four squares of integers greater than
$1$
. For any integer less than
$550$
, one may directly compute that
$$ \begin{align*} k_1(n) = \begin{cases} \infty & \text{if } n=1,2,3,5,6,7,10,11,14,15,19,23,\\ 6 & \text{if } n=39,55,\\ 5 & \text{if } n=30,35,46,51 \end{cases} \end{align*} $$
and
$k_1(n)\leq 4$
for all the other integers not given in the above. This completes the proof.
In the same way, one may easily prove by using Theorem 2.1 that
Furthermore,
$$ \begin{align*} k_2(n) = \begin{cases} 8 & \text{if } n=8,24,\\ 7 & \text{if } n=7,15,23,31,\\ 6 & \text{if } n=6,14,22,30,\\ 5 & \text{if } n=5,13,21,29,40,56,120,184 \end{cases} \end{align*} $$
and
$k_2(n)\leq 4$
for all the other integers not given above. For the case where
$\rho =3$
,
$$ \begin{align*} k_3(n) = \begin{cases} 6 & \text{if } n=15,\\ 5 & \text{if } n=11,14,23,35,47,59,71,95 \end{cases} \end{align*} $$
and
$k_3(n)\leq 4$
for all the other integers not given above. Furthermore,
and
$k_4(n)\leq 4$
for all the other integers not given above. Finally,
$k_5(79) =5$
and
${k_5(n)\leq 4}$
for any integer
$n\neq 79$
.
3 Complete determination of
$M(\rho )$
Throughout this section, we always assume that
$\rho \geq 6$
. We prove that
$M(\rho )=4$
if
$\rho $
is divisible by
$9$
or if it has a prime divisor greater than
$3$
, and
$M(\rho )=5$
otherwise.
Theorem 3.1. If
$\rho $
has a prime divisor greater than
$3$
, then
$M(\rho )=4$
.
Proof. In [Reference Kim and Oh7], it was shown that any integer n is a sum of at most four squares of integers not divisible by a prime p for any
$p\geq 5$
, except for the case when
$p=5$
and
$n=79$
. In the exceptional case, since
and we are assuming that
$\rho \ge 6$
, we have
$M(\rho )=4$
.
Now, we consider the case where
$\rho $
has no prime divisor greater than
$3$
.
Theorem 3.2. Let a be an integer greater than or equal to
$2$
and let
$\rho =2^{a+1}$
. Then, any positive integer n except for the integers in
is a sum of four squares of integers in
$S_{\rho }$
. Furthermore, any integer in
$N(\rho )$
is a sum of five squares of integers in
$S_{\rho }$
and hence,
$M(\rho )=5$
.
Proof. If the integer a is less than or equal to
$6$
, then one may prove the theorem by using Theorem 2.1. Hence, we always assume that
$a\ge 7$
. By Lagrange’s four square theorem, we may further assume that
$n \ge 2^{16}$
.
First, assume that
$n \equiv 1 \ (\mathrm {mod}\ 4)$
. Since the other case can be done in a similar manner, we further assume that
$n \equiv 1 \ (\mathrm {mod}\ 8)$
. Assume that a is odd. Since
$n-2^2$
is a sum of three squares of integers, there are nonnegative integers
$x,y,z$
with
${x \equiv 1 \ (\mathrm {mod}\ 2), \ y \equiv 2 \ (\mathrm {mod}\ 4)}$
and
$z\equiv 0 \ (\mathrm {mod}\ 4)$
such that
If
$z \ne \rho $
, then n is a sum of four squares in
$S_{\rho }$
. If
$z=\rho $
, then
as desired.
Now, assume that a is even. Similarly to the above, there are nonnegative integers
$x,y,z$
with
such that
If neither y nor z is equal to
$\rho $
, then n is a sum of four squares in
$S_{\rho }$
. If exactly one of y and z, say z, is equal to
$\rho $
, then
as desired. Assume that both y and z are equal to
$\rho $
, that is,
$n=x^2+2^{2a+3}+4^2$
. By similar reasoning to the above, we may assume that there is an integer
$x_1$
such that
$n=x_1^2+2^{2a+3}+16^2$
. Letting
$a=2b$
, note that
$$ \begin{align*} n=\begin{cases} x^2+(2^{2b+1}-4)^2+2^{2b+4}(2^{2b-2}+1), \\ x_1^2+(2^{2b+1}-16)^2+2^{2b+6}(2^{2b-4}+1). \\ \end{cases} \end{align*} $$
Since
$b \ge 4$
, at least one of
$2b-2$
or
$2b-4$
, say
$2b-2$
, has an odd prime factor. Hence,
$2^{2b-2}+1$
is not a prime and any prime dividing it is always congruent to
$1$
modulo
$4$
. Since the number of representations of the integer
$2^{2b-2}+1$
by a sum of two squares is equal to
$4\sum _{d\mid 2^{2b-2}+1} ((-1)/d)$
, there are integers
$s,t$
different from
$2^{b-1}$
such that
Therefore, n is a sum of four squares of integers in
$S_{\rho }$
.
If
$n \equiv 3+\epsilon ^2 \ (\mathrm {mod}\ 8)$
for
$\epsilon =0$
or
$2$
, then there are odd integers
$a,b$
and c such that
The theorem follows directly from this.
Now, assume that
$n \equiv 2 \ (\mathrm {mod}\ 4)$
. Then, there are nonnegative integers
$x_i,y_i$
and
$z_i$
for
$i=1,2$
with
$x_i \equiv y_i \equiv 1\ (\mathrm {mod}\ 2)$
and
$z_i \equiv 0\ (\mathrm {mod}\ 2)$
such that
If
$z_1$
or
$z_2$
is not equal to
$\rho $
, we are done. If
$z_1=z_2=2^{a+1}$
, then
$$ \begin{align*} n=\begin{cases} x_1^2+y_1^2+(2^{a+1}-2)^2+2^{a+3}, \\ x_2^2+y_2^2+(2^{a+1}-4)^2+2^{a+4}. \\ \end{cases} \end{align*} $$
In this case, the theorem follows directly from the fact that either
$a+3$
or
$a+4$
is even and
$2a+2>a+4$
.
If
$n\equiv 4 \ (\mathrm {mod}\ 8)$
, then n is a sum of four squares of odd integers.
Finally, assume that n is divisible by
$8$
. Let
$n=2^{2s}t$
, where
$t \equiv 2 \ (\mathrm {mod}\ 4)$
or
${t \equiv 4 \ (\mathrm {mod}\ 8)}$
. Assume that
$s \ge a+2$
. Since t is a sum of four squares of integers, there are integers
$x,y,z$
and w such that
Assume that
$s \le a-2$
. Then, there are integers
$x,y,z$
and w such that
Therefore,
Finally, assume that
$s=a+1,a$
or
$a-1$
. Let
$\epsilon =a+1-s$
. If t is a sum of four squares of integers in
$S_{2^{\epsilon }}$
, then n is a sum of four squares of integers in
$S_{\rho }$
. Note that for any integer t with
$t\equiv 2\ (\mathrm {mod}\ 4),\ t\equiv 4\ (\mathrm {mod}\ 8)$
, we have
$k_{2^\epsilon }(t)>4$
if and only if
$$ \begin{align*} t = \begin{cases} 2,6,10,14,30,46 & \text{if }\epsilon=0,\\ 6,14,22,30 & \text{if } \epsilon=1, \end{cases} \end{align*} $$
and there is no integer t such that
$k_4(t)>4$
. For any integer
$n=t\cdot ( {\rho }/{2^{\epsilon }})^2$
contained in
one may easily compute that
$k_{\rho }(n)=5$
. This completes the proof.
Theorem 3.3. Let a be a nonnegative integer and let
$\rho =3\cdot 2^{a+1}$
. Then, any positive integer n except for
$14\cdot 2^{2a+2}$
is a sum of four squares of integers in
$S_{\rho }$
. Furthermore,
$14\cdot 2^{2a+2}$
is a sum of five squares of integers in
$S_{\rho }$
and hence,
$M(\rho )=5$
.
Proof. The method of the proof is quite similar to that of Theorem 3.2. One may consider
$n-(3\cdot 2^\alpha )^2$
instead of
$n-(2^\alpha )^2$
for
$\alpha =1,2$
and
$4$
in the previous theorem. Since all the other arguments are quite similar to those in the previous theorem, the proof is left as an exercise to the reader.
Now, we assume that
$\rho =2^s\cdot 3^t$
, where
$s\geq 0$
and
$t\geq 2$
.
Proposition 3.4. Assume that an integer n is a sum of three squares of integers. Then, there exist integers
$a, b$
and c such that
In particular, if n is divisible by
$3$
, then n is a sum of three squares of integers not divisible by
$3$
.
Proof. Since the ternary quadratic form
$I_3=x^2+y^2+z^2$
is isotropic and unimodular over
$\mathbb {Z}_3$
, it is primitively universal over
$\mathbb {Z}_3$
, that is, it primitively represents all integers over
$\mathbb Z_3$
. Moreover, the class number of
$I_3$
is
$1$
. So, if n is represented by
$I_3$
over
$\mathbb {Z}$
, then there exists a representation of n by
$I_3$
over
$\mathbb {Z}$
, which is a primitive representation over
$\mathbb Z_3$
by [Reference O’Meara10, Section 102.5]. Therefore, if an integer n divisible by
$3$
is represented by
$I_3$
, then there are integers
$a,b$
and c such that
This completes the proof.
Proposition 3.5. Let
$a_0,\ a_1$
and
$a_2$
be nonzero integers such that
$a_0 \equiv 0 \ (\mathrm {mod}\ 9)$
,
$a_1 \equiv 1 \ (\mathrm {mod}\ 3)$
and
$a_2\equiv 2\ (\mathrm {mod}\ 3)$
. Then, there are integers
$b_0,\ b_1$
and
$b_2$
such that
Proof. If we let
$a_0 = 3A$
, then
$A\equiv 0\ (\mathrm {mod}\ 3)$
. Clearly, both
$m = (a_0 + a_1 + a_2)/3$
and
$m' = (-a_0 + a_1 + a_2)/3 = m - 2A$
are integers. Note that
$$ \begin{align*} a_0^2 + a_1^2 + a_2^2 & = (2m-a_0)^2 + (2m-a_1)^2 + (2m-a_2)^2,\\ (-a_0)^2 + a_1^2 + a_2^2 & = (2m'+a_0)^2 + (2m'-a_1)^2 + (2m'-a_2)^2\text. \end{align*} $$
Define
$b_i = 2m - a_i$
for
$0\le i\le 2$
, and
If
$\pm a_0 \notin \{b_0, b_1, b_2\}$
, then we are done. Suppose that
$ua_0 = b_i$
for some
$u\in \{\pm 1\}$
and
${0\le i\le 2}$
. We claim that
$\pm a_0 \notin \{b^{\prime }_0, b^{\prime }_1, b^{\prime }_2\}$
. Let
$\{i, j, k\} = \{0, 1, 2\}$
. Since
$m \equiv m' \ (\mathrm {mod}\ 3)$
,
Hence, neither
$b^{\prime }_j$
nor
$b^{\prime }_k$
is equal to
$\pm a_0$
. Now, suppose that
$b^{\prime }_i =\pm a_0$
for a suitable sign. Then,
However,
$b^{\prime }_1 - b_1 = b^{\prime }_2 - b_2 = 2m' - 2m = -4A$
and
$b^{\prime }_0 - b_0 = 2m' + a_0 - 2m + a_0 = 2A$
, which is absurd. This proves the proposition.
Theorem 3.6. If
$\rho $
is divisible by
$9$
, then
$M(\rho )=4$
.
Proof. Let n be any positive integer. Then, there are integers
$a,b,c$
and d such that
by Lagrange’s four square theorem.
Assume that
$n\equiv 0\ (\mathrm {mod}\ 3) $
. Then, all of
$a,b,c$
and d are divisible by
$3$
or exactly one of them is divisible by
$3$
. If
$\lvert a \rvert =\lvert b\rvert =\lvert c \rvert = \lvert d \rvert =\rho $
, then
$n=(2\rho )^2+0^2+0^2+0^2$
. So we may suppose that at least one of them is not
$\rho $
. Without loss of generality, we assume that
$\lvert d\rvert \neq \rho $
. Then,
$n-d^2\equiv 0,2 \ (\mathrm {mod}\ 3)$
is a sum of three squares. Hence, by Propositions 3.4 and 3.5,
$n-d^2$
is a sum of three squares of integers in
$S_\rho $
.
Assume that
$n\equiv 1\ (\mathrm {mod}\ 3) $
. Then, we may assume
$a\not \equiv 0\ (\mathrm {mod}\ 3) $
. Since
$n-a^2\equiv 0\ (\mathrm {mod}\ 3) $
,
$n-a^2$
is a sum of three squares not divisible by
$3$
by Proposition 3.4, as desired.
Finally, assume that
$n\equiv 2\ (\mathrm {mod}\ 3) $
. Then, exactly two of
$a,b,c$
and d are divisible by
$3$
. Without loss of generality, we assume that
$a,b\equiv 0\ (\mathrm {mod}\ 3)$
. If neither
$\lvert a \rvert $
nor
$\lvert b \rvert $
is equal to
$\rho $
, then we are done. If
$\lvert a \rvert =\rho $
and
$\lvert b \rvert \neq \rho $
, then by Proposition 3.5, there are integers
$a', c'$
and
$d'$
such that
where all of
$\lvert a' \rvert $
,
$\lvert c' \rvert $
and
$\lvert d' \rvert $
are not equal to
$\rho $
. Assume that
$\lvert a \rvert = \lvert b \rvert =\rho $
. Then, by Proposition 3.5, there are integers
$a', c'$
and
$d'$
such that
where all of
$\lvert a' \rvert $
,
$\lvert c' \rvert $
and
$\lvert d' \rvert $
are not equal to
$\rho $
. We may assume that
$a'$
is divisible by
$3$
. Then, by Proposition 3.5 again, there are integers
$b', c"$
and
$d"$
such that
where all of
$\lvert b' \rvert , \lvert c" \rvert $
and
$\lvert d" \rvert $
are not equal to
$\rho $
. The theorem follows directly from this.

