Sunday 27 September 2015

Sum of Two Squares


Figure 1

I'm currently reading the book whose cover appears in Figure 1. As the title suggests, the author just deals with the numbers from \(1\) to \(9\). While some of the topics are a little inaccessible, the majority are understandable and several of them I'll be revisiting in subsequent posts.

I'll address one of the topics here and now however, and this one concerns the conditions necessary for a prime number to be expressed as a sum of two squares. Fermat's theorem on the sums of two squares states that any prime number that is congruent to 1 modulus 4 can be expressed as a sum of two squares. Another way of expressing this is to say that the prime can be represented as \(4k+1\) for some \(k \geq 1\). 

The first instance of such a prime is 5, corresponding to \(k=1\), and it can be expressed as \(2^2+1^2 \). When \(k=3\), we have the prime 13 and it can be expressed as \(3^2+2^2\). My last prime day is another example and is expressible as: \(24281= 16^2+155^2\). 

However, what if the number is composite? It appears that the condition in that case is that none of the \(4k+3\) primes can have an odd exponent. For example, \(21=3 \times 7 \) with both 3 and 7 being of the form \(4k+3\) with \(k=0\) and \(k=1\) respectively. Both are raised to the odd power 1 and thus 21 cannot be written as a sum of two squares.

However, \(45=3^2 \times 5 \) and, though 3 is a factor, it is raised to an even power. Thus 45 can be written as a sum of two squares, specifically \(6^2+3^2\). A larger composite number is \(24274=2 \times 53 \times 229\) and it is expressible as a sum of two squares in two ways, namely \(24274=57^2+145^2\) and \(93^2+125^2\). In this case, none of the prime factors is of the \(4k+3\) variety.

To determine in how many ways a number can be written as a sum of two squares, all that needs to be done is to:
  • add 1 to the index of each 4\(k\)+1 factor
  • multiply these new indices together
  • divide the product by 2
  • if the product is an odd number, then round up
If 2 or a power of 2 is present, it has no effect and, as we said, all \(4k+3\) factors must be raised to even powers. In the case of 24274, the indices of 53 and 229 are 1 and 1 respectively which become 2 and 2. Multiplying 2 by 2 and dividing by 2 gives 2 and thus its representation as a sum of two squares in two different ways.

In the case of a number that is a perfect square \(n\), the trivial \(0^2+(\sqrt(n))^2\) is also included as a solution. For example, consider 25 = 5 * 5. The rule again gives 2 by 2 divided by 2 and so there are two ways to express the number as a sum of two squares. One way is \(3^2+4^2\) and the other way is \(0^2+5^2\).

As a further example, consider the perfect square:$$ \begin {align} 710222500 &=26650^2\\ &=2^2 \times 5^4 \times 13^2 \times 41^2 \end{align}$$This number has \(4k+1\) indices of 4, 2, 2 which become 5, 3, 3 when 1 is added. The product is 45 which, when divided by 2 and rounded up, becomes 23. So there are 22 ways in which the number can be expressed a sum of two positive integers and the other way is as \(0^2+26650^2\).

on December 19th 2020, December 22nd 2021 and March 21st 2022

This future post in May 2018 collects a variety of posts (including this one) 
that relate to the topic of the sums of squares.

No comments:

Post a Comment