Representation of Integers of the Form x^{2} + ky^{2} − lz^{2}

Supawadee Prugsapitak and Nattaporn Thongngam Algebra and Applications Research Unit Division of Computational Science Faculty of Science Prince of Songkla University Hatyai, Songkhla 90110 Thailand

                     supawadee.p@psu.ac.th
                     6310220031@psu.ac.th

Abstract A positive integer l is k-special if for every integer n there exist non-zero integers x, y, and z such that n = x^{2} + ky^{2} − lz^{2}. For all odd integers k, we find infinite classes of k-special numbers and 2k-special numbers.

1 Introduction

The representations of a natural number as a sum of squares have been widely studied by many mathematicians. Nowicki [3] and Lam [2] proved that all natural numbers can be written in the form x^{2} + y^{2} − cz^{2} where xyz ≠ 0 if and only if c is of the form q or 2q, where either q = 1 or q is a product of primes of the form 4m + 1. Later, Prugsapitak and Thongngam [4] defined a k-special number. A positive integer l is k-special if every integer n can be expressed as n = x^{2} + ky^{2} − lz^{2} for some non-zero integers x, y, and z. They proved that 1 is k-special if and only if k is not divisible by 4.

In this article, we will be interested in representing natural numbers in the form x^{2} + ky^{2} − lz^{2} where xyz ≠ 0 for given positive integers k and l. For all odd integers k, we apply Lam’s method [2] to identify k-special numbers and 2k-special numbers and additionally we show that there are infinitely many k-special numbers and 2k-special numbers.

2 Main results

In this section, we present k-special and 2k-special number for an odd integer k. We can show that x^{2} + 2ky^{2} where gcd(x, 2ky) = 1 and x^{2} + ky^{2} where gcd(x, ky) = 1 are 2k-special and k-special respectively by modifying Lam’s approach [2].

Theorem 1. Let k and l be odd integers. If l can be written as x^{2} + 2ky^{2} for some positive integers x and y where gcd(x, 2ky) = 1, then l is 2k-special.

Proof. Let l be an odd integer and l = x^{2} + 2ky^{2} for some positive integers x and y where gcd(x, 2ky) = 1. We first find the representation of odd numbers of the form a^{2} + 2kb^{2} − lc^{2} where abc ≠ 0. Since gcd(x, 2ky) = 1, there exist integers α_{0} and β_{0} such that

xα_{0} + 2kyβ_{0} = 1.

For a positive integer n, let α_{n} = α_{0} + 2nky and β_{n} = β_{0} − nx. It is easy to see that

xα_{n} + 2kyβ_{n} = x(α_{0} + 2nky) + 2ky(β_{0} − nx) = xα_{0} + 2kyβ_{0} = 1.

Next, let a_{n} = xj + α_{n}, b_{n} = yj + β_{n} and c_{n} = j, where j is an integer which will be chosen later. Thus

a_{n}^{2} + 2kb_{n}^{2} − lc_{n}^{2} = (xj + α_{n})^{2} + 2k(yj + β_{n})^{2} − (x^{2} + 2ky^{2})j^{2}
= x^{2}j^{2} + 2xjα_{n} + α_{n}^{2} + 2ky^{2}j^{2} + 4ykjβ_{n} + 2kβ_{n}^{2} − x^{2}j^{2} − 2ky^{2}j^{2}
= 2xjα_{n} + 4ykjβ_{n} + α_{n}^{2} + 2kβ_{n}^{2}
= 2j(xα_{n} + 2kyβ_{n}) + α_{n}^{2} + 2kβ_{n}^{2}.

Since x is odd and xα_{n} + 2kyβ_{n} = 1, we can see that α_{n} is odd. Thus

a_{i}^{2} + 2kb_{i}^{2} − lc_{i}^{2} = 2j + α_{i}^{2} + 2kβ_{i}^{2}

for non-negative integers i. Let m be an odd integer. For a non-negative integer n, we choose a suitable value of an integer j_{n} such that

m = 2j_{n} + α_{n}^{2} + 2kβ_{n}^{2} = a_{n}^{2} + 2kb_{n}^{2} − lc_{n}^{2}

where a_{n} = xj_{n} + α_{n}, b_{n} = yj_{n} + β_{n} and c_{n} = j_{n}. We can see that a_{n}b_{n}c_{n} = 0 if and only if m is one of the following values; α_{n}^{2} + 2kβ_{n}^{2}, α_{n}^{2} + 2kβ_{n}^{2} − 2α_{n}/x or α_{n}^{2} + 2kβ_{n}^{2} − 2β_{n}/y. Since

lim_{n→∞} α_{n} = lim_{n→∞} −β_{n} = ∞,

there exists a non-negative integer n such that α_{n}^{2}+2kβ_{n}^{2}−2α_{n}/x > m and β_{n} < 0. Therefore we obtain a representation for m, namely m = a_{n}^{2} + 2kb_{n}^{2} − lc_{n}^{2} where a_{n}b_{n}c_{n} ≠ 0.

We next find the representation of even integers. Since gcd(x, 2ky) = 1, we have gcd(x, ky) = 1. Then there exist integers α_{0} and β_{0} such that

xα_{0} + kyβ_{0} = 1.

For a positive integer n, let α_{n} = α_{0} + kny and β_{n} = β_{0} − nx. Then

xα_{n} + kyβ_{n} = x(α_{0} + kny) + ky(β_{0} − nx) = xα_{0} + kxny + kyβ_{0} − kynx = xα_{0} + kyβ_{0} = 1.

Now let a_{n} = xj+2α_{n}, b_{n} = yj+β_{n} and c_{n} = j where j is an integer which will be determined later. Then

a_{n}^{2} + 2kb_{n}^{2} − lc_{n}^{2} = (xj + 2α_{n})^{2} + 2k(yj + β_{n})^{2} − (x^{2} + 2ky^{2})j^{2}
= x^{2}j^{2} + 4xjα_{n} + 4α_{n}^{2} + 2ky^{2}j^{2} + 4ykjβ_{n} + 2kβ_{n}^{2} − x^{2}j^{2} − 2ky^{2}j^{2}
= 4j(xα_{n} + kyβ_{n}) + 4α_{n}^{2} + 2kβ_{n}^{2}.

Since x is odd, we have

4α_{n}^{2} + 2kβ_{n}^{2} = 4(α_{0} + kny)^{2} + 2k(β_{0} − nx)^{2}
= 4α_{0}^{2} + 8knyα_{0} + 4k^{2}n^{2}y^{2} + 2kβ_{0}^{2} − 4knxβ_{0} + 2kn^{2}x^{2}
≡ 2kβ_{0}^{2} + 2kn^{2}x^{2} (mod 4)
≡ 2kβ_{0}^{2} + 2kn^{2} (mod 4).

Thus,

4α_{n}^{2} + 2kβ_{n}^{2} ≡ \begin{cases}2kβ_{0}^{2} (mod 4), & if n is even; \\ 2k(β_{0}^{2} + 1) (mod 4), & if n is odd. \end{cases}

For every non-negative integer r, we obtain two identities for representing even integers given by

a_{2r}^{2} + 2kb_{2r}^{2} − lc_{2r}^{2} = (xj + 2α_{2r})^{2} + 2k(yj + β_{2r})^{2} − (x^{2} + 2y^{2})j^{2} = 4j + 4α_{2r}^{2} + 2kβ_{2r}^{2}

and

a_{2r+1}^{2} + 2kb_{2r+1}^{2} − lc_{2r+1}^{2} = (xj + 2α_{2r+1})^{2} + 2(yj + β_{2r+1})^{2} − (x^{2} + 2y^{2})j^{2}
= 4j + 4α_{2r+1}^{2} + 2kβ_{2r+1}^{2}.

Let m be an even integer. There are four cases to consider; namely,

• Case 1: m ≡ 0 (mod 4) and β_{0}^{2} ≡ 0 (mod 4),

• Case 2: m ≡ 2 (mod 4) and β_{0}^{2} ≡ 0 (mod 4), • Case 3: m ≡ 0 (mod 4) and β_{0}^{2} ≡ 1 (mod 4),

• Case 4: m ≡ 2 (mod 4) and β_{0}^{2} ≡ 1 (mod 4).

Since all cases can be handled similarly, we provide the proof for Case 1 as follows. We choose a suitable value of an integer j_{2r} such that

m = 4j_{2r} + 4α_{2r}^{2} + 2kβ_{2r}^{2} = a_{2r}^{2} + 2kb_{2r}^{2} − lc_{2r}^{2}

where a_{2r} = xj_{2r} + 2α_{2r}, b_{2r} = yj_{2r} + β_{2r} and c_{2r} = j_{2r}. We can see that a_{2r}b_{2r}c_{2r} = 0 if and only if m is one of the following values: 4α_{2r}^{2} + 2kβ_{2r}^{2}, 4α_{2r}^{2} + 2kβ_{2r}^{2} − 8α_{2r}/x or 4α_{2r}^{2} + 2kβ_{2r}^{2} − 4β_{2r}/y. Since

lim_{r→∞} α_{2r} = lim_{r→∞} −β_{2r} = ∞,

there exists a non-negative integer r such that 4α_{2r}^{2} + 2kβ_{2r}^{2} − 8α_{2r}/x > m and β_{2r} < 0. Therefore we obtain a representation for m, namely m = a_{2r}^{2} + 2kb_{2r}^{2} − lc_{2r}^{2} where a_{2r}b_{2r}c_{2r} ≠ 0.

For an odd integer k, we obtain a sufficient condition for an odd integer to be 2k-special. The necessary condition is unknown to us. However we can provide a necessary condition for the 2-special number. That is, if d is 2-special, then d = m^{2} + 2n^{2} for some integers m and n. We first recall a well-known lemma (see, for example, [1]) before proving our mentioned conclusion.

Lemma 2. Let p be a prime. Then p = x^{2} + 2y^{2} for some integers x and y if and only if p = 2 or p ≡ 1, 3 (mod 8).

Using the above lemma, we have the following.

Lemma 3. A positive integer n can be written as x^{2} + 2y^{2} for some integers x and y if and only if all primes of the form 8k + 5 or 8k + 7 have an even exponent in the prime factorization of n.

Proof. If n = x^{2} + 2y^{2} for some integers x and y, then

n = x^{2} + 2y^{2} = (x + y\sqrt{−2})(x − y\sqrt{−2}).

Let p be a prime of the form 8k + 5 or 8k + 7 and p divides n. Since −2 is a quadratic non-residue modulo p, we see that p is a prime in ℤ[\sqrt{−2}]. Thus p divides x + y\sqrt{−2} or p divides x − y\sqrt{−2}. If p divides x + y\sqrt{−2}, then p divides x − y\sqrt{−2}. Hence p divides 2x and p divides 2y. Since p is odd, we have that p divides both x and y. Similarly, we can show that if p divides x−y\sqrt{−2}, then p divides both x and y. Write x = px_{1} and y = py_{1} for some integers x_{1} and y_{1}. Therefore n = p^{2}x_{1}^{2} + 2p^{2}y_{1}^{2} = p^{2}(x_{1}^{2} + 2y_{1}^{2}). If p ∤ x_{1}^{2} + 2y_{1}^{2}, then p^{2}||n. If p divides x_{1}^{2} + 2y_{1}^{2}, then p^{2} divides x_{1}^{2} + 2y_{1}^{2}. We can repeat the process until we arrive at the conclusion that p has even multiplicity in the prime factorization of n. Conversely, we know that 2 and all primes p where p ≡ 1, 3 (mod 8) can be written as a^{2} + 2b^{2} for some integers a and b and a product of integers of the form a^{2} + 2b^{2} is still an integer of the form a^{2} + 2b^{2}. Therefore the result follows.

Theorem 4. If d is 2-special, then d = m^{2} + 2n^{2} for some integers m and n.

Proof. Let d be 2-special. For all integers c there exist non-zero integers x, y, and z such that x^{2} + 2y^{2} − dz^{2} = 2dc^{2}. So x^{2} + 2y^{2} = d(z^{2} + 2c^{2}). By Lemma 3, all primes of the form 8k + 5 or 8k + 7 have even exponent in the prime factorization of x^{2} + 2y^{2} and 2c^{2} + z^{2}. Thus all primes of the form 8k + 5 or 8k + 7 have even exponent in the prime factorization of d. Hence again by Lemma 3, we have that d is of the form m^{2} + 2n^{2} for some integers m and n.

The converse of the above theorem is not true, as we will discover in the next theorem that 8 is not 2-special.

Theorem 5. Let k be an odd integer. If d is divisible by 8, then d is not 2k-special.

Proof. Let d be divisible by 8. Suppose on the contrary that d is 2k-special. Then

x^{2} + 2ky^{2} − dz^{2} = 5

for some non-zero integers x, y, and z. So x^{2} + 2ky^{2} ≡ 5 (mod 8). Since x^{2} ≡ 0, 1, 4 (mod 8) and 2ky^{2} ≡ 0, 2k (mod 8), it is easy to see that x^{2} + 2ky^{2} ≡ 0, 1, 4, 2k, 2k + 1, 2k + 4 (mod 8). Since k is odd, we can see that x^{2} + 2ky^{2} ≢ 5 (mod 8). This is a contradiction.

Next, we consider k-special numbers where k is odd.

Theorem 6. Let l and k be odd integers. If l = x^{2} + ky^{2} for some positive integers x and y and gcd(x, ky) = 1, then l is k-special.

Proof. Suppose l = x^{2} + ky^{2} for some positive integers x and y where gcd(x, ky) = 1. Since gcd(x, ky) = 1, there exist integers α_{0} and β_{0} such that xα_{0} + kyβ_{0} = 1.

For a positive integer n, we define α_{n} = α_{0} + nky and β_{n} = β_{0} − nx. Then

xα_{n} + kyβ_{n} = x(α_{0} + nky) + ky(β_{0} − nx)
= xα_{0} + xnky + kyβ_{0} − nkyx
= xα_{0} + kyβ_{0} = 1.

Let a_{n} = xj + α_{n}, b_{n} = yj + β_{n} and c_{n} = j, where j is an integer which will be selected later. Thus

a_{n}^{2} + kb_{n}^{2} − lc_{n}^{2} = (xj + α_{n})^{2} + k(yj + β_{n})^{2} − (x^{2} + ky^{2})j^{2}
= x^{2}j^{2} + 2xjα_{n} + α_{n}^{2} + ky^{2}j^{2} + 2kyjβ_{n} + kβ_{n}^{2} − x^{2}j^{2} − ky^{2}j^{2}
= 2xjα_{n} + α_{n}^{2} + 2kyjβ_{n} + kβ_{n}^{2}
= 2j(xα_{n} + kyβ_{n}) + α_{n}^{2} + kβ_{n}^{2}.

We have

α_{n}^{2} + kβ_{n}^{2} = (α_{0} + nky)^{2} + k(β_{0} − nx)^{2}
= α_{0}^{2} + 2knα_{0}y + n^{2}k^{2}y^{2} + kβ_{0}^{2} − 2nkβ_{0}x + kn^{2}x^{2}
≡ α_{0}^{2} + kβ_{0}^{2} + n^{2}k^{2}y^{2} + kn^{2}x^{2} (mod 2).

Therefore,

α_{n}^{2} + kβ_{n}^{2} ≡ \begin{cases}α_{0}^{2} + kβ_{0}^{2} (mod 2), & if n is even; \\ α_{0}^{2} + kβ_{0}^{2} + y^{2} + x^{2} (mod 2), & if n is odd. \end{cases}

Since l and k are odd, we can see that x and y have different parities. Thus

α_{n}^{2} + kβ_{n}^{2} ≡ \begin{cases}α_{0}^{2} + kβ_{0}^{2} (mod 2), & if n is even; \\ α_{0}^{2} + kβ_{0}^{2} + 1 (mod 2), & if n is odd. \end{cases}

For all non-negative integers r, we obtain the following identities

a_{2r}^{2} + kb_{2r}^{2} − lc_{2r}^{2} = 2j + α_{2r}^{2} + kβ_{2r}^{2} ≡ 2j + α_{0}^{2} + kβ_{0}^{2} (mod 2),
a_{2r+1}^{2} + kb_{2r+1}^{2} − lc_{2r+1}^{2} = 2j + α_{2r+1}^{2} + kβ_{2r+1}^{2} ≡ 2j + α_{0}^{2} + kβ_{0}^{2} + 1 (mod 2).

By using both identities, we can demonstrate that all integers can be expressed in the form a^{2} + kb^{2} − lc^{2}. Next, we will illustrate how to choose a, b, and c so that abc ≠ 0.

Case 1: α_{0}^{2} + kβ_{0}^{2} ≡ 0 (mod 2).

We first consider how to represent an even integer m. We select an appropriate value for j_{2r} such that

m = 2j_{2r} + α_{2r}^{2} + kβ_{2r}^{2} = a_{2r}^{2} + kb_{2r}^{2} − lc_{2r}^{2}

where a_{2r} = xj_{2r} + α_{2r}, b_{2r} = yj_{2r} + β_{2r} and c_{2r} = j_{2r}. We can see that a_{2r}b_{2r}c_{2r} = 0 if and only if m is one of the following values: α_{2r}^{2} +kβ_{2r}^{2}, α_{2r}^{2} +kβ_{2r}^{2} −2α_{2r}/x or α_{2r}^{2} +kβ_{2r}^{2} −2β_{2r}/y. Since

lim_{r→∞} α_{2r} = lim_{r→∞} −β_{2r} = ∞,

there exists a non-negative integer r for which α_{2r}^{2} + kβ_{2r}^{2} − 2α_{2r}/x > m and β_{2r} < 0. As a result, we have a representation for m, namely m = a_{2r}^{2} + kb_{2r}^{2} − lc_{2r}^{2} where a_{2r}b_{2r}c_{2r} ≠ 0.

Next, we consider a representation for an odd integer m. Let m be an odd integer. We select an appropriate value for j_{2r+1} such that

m = 2j_{2r+1} + α_{2r+1}^{2} + kβ_{2r+1}^{2} = a_{2r+1}^{2} + kb_{2r+1}^{2} − lc_{2r+1}^{2}

where a_{2r+1} = xj_{2r+1} + α_{2r+1}, b_{2r+1} = yj_{2r+1} + β_{2r+1} and c_{2r+1} = j_{2r+1}. It is easy to see that a_{2r+1}b_{2r+1}c_{2r+1} = 0 if and only if m is one of the values listed below: α_{2r+1}^{2} + kβ_{2r+1}^{2}, α_{2r+1}^{2} + kβ_{2r+1}^{2} − 2α_{2r+1}/x or α_{2r+1}^{2} + kβ_{2r+1}^{2} − 2β_{2r+1}/y. Since

lim_{r→∞} α_{2r+1} = lim_{r→∞} −β_{2r+1} = ∞,

there exists a non-negative integer r such that α_{2r+1}^{2} +kβ_{2r+1}^{2} −2α_{2r+1}/x > m and β_{2r+1} < 0. As a consequence, a representation for m is obtained as follows: m = a_{2r+1}^{2} + kb_{2r+1}^{2} − lc_{2r+1}^{2} where a_{2r+1}b_{2r+1}c_{2r+1} ≠ 0.

Case 2: α_{0}^{2} + kβ_{0}^{2} ≡ 1 (mod 2). This case can be handled similarly as in Case 1. Thus l is k-special as desired.

Finally, we obtain the following consequence of Theorem 1 and Theorem 6.

Corollary 7. Let k be an odd integer. There are infinitely many k-special numbers and 2k-special numbers.

3 Acknowledgments

We would like to express our gratitude to the reviewers for their comments and suggestions on how to improve our manuscript.

References

[1] S. Alaca and K. S. Williams, Introductory Algebraic Number Theory, Cambridge University Press, 2004.

[2] P. C. H. Lam, Representation of integers using a^{2} + b^{2} − dc^{2}, J. Integer Sequences 18 (2015), Article 15.8.6.

[3] A. Nowicki, The numbers a^{2} + b^{2} − dc^{2}, J. Integer Sequences 18 (2015), Article 15.2.3.

[4] S. Prugsapitak and N. Thongngam, The numbers a^{2} + mb^{2} − c^{2}, J. Integer Sequences 24 (2021), Article 21.7.7.

2010 Mathematics Subject Classification: Primary 11E25. Keywords: sum of squares.

Received November 10 2021; revised versions received December 21 2021; April 15 2022; April 24 2022; October 18 2022; October 24 2022. Published in Journal of Integer Sequences, October 25 2022.

Return to Journal of Integer Sequences home page.