Showing posts with label sum of squares. Show all posts
Showing posts with label sum of squares. Show all posts

Tuesday, 16 September 2025

A Special Date

 I came across this article today that discusses today's date: the 16th of September 2025:

Once a century, a very special day comes along. That day is today — 9/16/25.

Pi Day (3/14) often comes with sweet treats; Square Root Day (4/4/16 or 5/5/25, for example) has a certain numerical rhyme. But the particular string of numbers in today's date may be especially delightful to the brains of mathematicians and the casual nerds among us.

First, "all three of the entries in that date are perfect squares — and what I mean by that is \(9\) is equal to \(3^2\), \(16\) is equal to \(4^2\), and \(25\) is equal to \(5^2,\)" says Colin Adams, a mathematician at Williams College who was first tipped off about today's special qualities during a meeting with his former student, Jake Malarkey.

Next, those perfect squares come from consecutive numbers — three, four, and five.

But perhaps most special of all is that three, four, and five are an example of what's called a Pythagorean triple.

"And what that means," explains Adams, "is that if I take the sum of the squares of the first two numbers, \(3^2 + 4^2\), which is \(9 + 16\) is equal to \(25\), which is \(5^2\), so \(3^2 + 4^2 = 5^2\)."

This is the Pythagorean Theorem: \(a^2 + b^2 = c^2\). "And that in fact is the most famous theorem in all of mathematics," says Adams.

It's a theorem that means something geometrically, too. Any Pythagorean triple — including 3, 4, and 5 — also gives the lengths of the three sides of a right triangle. That is, the squares of the two shorter lengths add up to the square of the final, longer side (the hypotenuse).

There are no other dates this century that meet all these conditions, so most of us will experience it just once in our lifetime.

(Fun bonus: It turns out the full year, \(2025\), is also a perfect square: \(45 \times 45\).)

In any case, Adams says that if it were up to him, he'd call the day Pythagorean Triple Square Day. And he plans on celebrating with a rectangular cake cut along the diagonal to yield two right triangles.

"If I have any luck at all, if I can find a cake with the right dimensions, it'll look like a 3, 4, 5 cake, namely edge length 3, edge length 4, and edge length 5," he says. In the middle, he intends to have the date inscribed in icing.

"This date is hiding one of the most beautiful coincidences we will ever encounter," says Terrence Blackman, chair of the mathematics department at Medgar Evers College in the City University of New York. "Those numbers, they tell a story that goes back to ancient Greece."

Blackman says the Pythagorean Theorem is used frequently by carpenters and architects. But for him, as a mathematician, today's date captures a special elegance.

"It reveals some kind of hidden mathematical poetry that is sitting there — just like walking and coming upon a beautiful flower," he says.

In a world that can feel chaotic, Blackman feels that a day like today shows that math can provide a source of comfort.

"It reminds us that beauty and meaning can be found anywhere and everywhere," he says. "We just have to continue to look for it."

Wednesday, 28 August 2024

Some Special Sums of Squares and Cubes

It's well known that some numbers can be written as the sum of two squares. The number 2 is the first such number because:$$2=1^2+1^2$$The first number that can be written as the sum of two distinct squares is 5 because:$$5=2^2+1^2$$However, let's consider the number 20 where we have:$$20 = 2^2 + 4^2$$What makes 20 special is that the divisors of 20 are 1, 2, 4, 5, 10 and 20. Two of the divisors, 2 and 4, form the base of the two squares that add together to total 20. This is the first such number with this property and, up to 40000, the other numbers are (permalink):

20, 80, 90, 180, 272, 320, 360, 468, 500, 650, 720, 810, 980, 1088, 1280, 1332, 1440, 1620, 1872, 2000, 2250, 2420, 2448, 2450, 2600, 2880, 2900, 3240, 3380, 3600, 3920, 4160, 4212, 4352, 4410, 4500, 5120, 5328, 5760, 5780, 5850, 6480, 6642, 6800, 7220, 7290, 7488, 7650, 8000, 8820, 9000, 9680, 9792, 9800, 10100, 10388, 10400, 10580, 10890, 11520, 11600, 11700, 11988, 12500, 12960, 13328, 13520, 14400, 14580, 14762, 15210, 15680, 16250, 16400, 16640, 16820, 16848, 17408, 17640, 18000, 19220, 20250, 20480, 20880, 21312, 21780, 22032, 22050, 22932, 23040, 23120, 23400, 24500, 25578, 25920, 26010, 26100, 26568, 27200, 27380, 27540, 28730, 28880, 29160, 29952, 30420, 30600, 31850, 32000, 32400, 32490, 32912, 33300, 33620, 35280, 36000, 36980, 37440, 37908, 38612, 38720, 39168, 39200, 39690

Looking more closely at these numbers it can be seen that some are multiples of smaller numbers. For example, consider the second number in the sequence: 80. We find that:$$ \begin{align} 80 &= 4^2+8^2\\ &=2^2(2^2+4^2) \\ &=4 \times 20 \end{align}$$Numbers like 20 are called primitive numbers and form OEIS A338485:


 A338485

Primitive numbers that are the sum of the squares of two of their distinct divisors.



The members of this sequence up to 40000 are (permalink):

20, 90, 272, 468, 650, 1332, 2450, 2900, 3600, 4160, 6642, 7650, 10100, 10388, 14762, 16400, 20880, 25578, 27540, 28730, 38612

Let's look at the last member in the sequence above: 38612. We have:$$  38612 = 14^2+196^2$$The divisors of 38612 are 1, 2, 4, 7, 14, 28, 49, 98, 196, 197, 394, 788, 1379, 2758, 5516, 9653, 19306, 38612 and we can see that 14 and 196 are represented.

Figure 1 shows a list bases for the squares that form the primitive and non-primitive numbers from 27540 upwards.


Figure 1

20 is the first number than can be represented as the sum of squares of two of its divisors

I was naturally curious as to whether there were primitive numbers that are the sum of the cubes of two of their distinct divisors. There are indeed. The numbers, not necessarily primitive with this property, are up to 40000 (permalink):

72, 520, 576, 756, 1944, 4160, 4608, 6048, 7560, 9000, 14040, 15552, 15750, 19656, 19710, 20412, 24696, 32832, 33280, 36864

The primitive numbers up to 40000 are (permalink):

72, 520, 576, 756, 1944, 4160, 6048, 7560, 9000, 14040, 15552, 15750, 19656, 19710, 20412, 24696, 32832

The first number in the first list not to appear in the second list is 4608 which can be rendered as:$$ \begin{align} 4608 &= 8^3+16^3 \\  &=2^3 (4^3+8^3) \\ &=8 \times 576 \end{align}$$It can be seen then that 4608 is not a primitive number whereas 576 is. 576 has divisors of 1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 32, 36, 48, 64, 72, 96, 144, 192, 288 and 576 and 4 and 8 are included amongst these divisors.

The algorithm used to generate these lists is easily modified to accommodate fourth, fifth etc. powers if one is interested. I'll stop with the cubes in this post. Figure 2 shows what the bases of the cubes are for the primitive and non-primitive numbers.


Figure 2

Thursday, 8 December 2022

Sums of Squares Pattern

I watched an interesting video that describes a pattern involving sums of squares. The property can be stated as follows:$$n^2+(n+1)^2+n^2 \cdot (n+1)^2 =(n \cdot (n+1)+1)^2\\ \text{where both sides are equal to } n^4 + 2n^3 + 3n^2 + 2n + 1$$The author of the video arrives at the pattern by considering specific numerical examples and doesn't look at the underlying algebra.

The pattern is more meaningful when we look at some specific examples:$$ \begin{align} 1^2+2^2+2^2&=3^2\\2^2+3^2+6^2&=7^2\\3^2+4^2+12^2&=13^2\\4^2+5^2+20^2&=21^2\\5^2+6^2+30^2&=31^2 \end{align}$$Looking at this property the other way, we can say that for any integer \(a\):$$a^2=(a-1)^2+x^2+(x+1)^2$$where \(x\) is an integer such that \(x \cdot (x+1)=a-1\) if such integers exist, which of course will not often be the cause.

However, number of the form \(x \cdot (x+1) \) are pronic and members of OEIS A002378:


 A002378



Oblong (or promic, pronic, or heteromecic) numbers: \(a(n) = n \cdot (n+1) \).   
              

0, 2, 6, 12, 20, 30, 42, 56, 72, 90, 110, 132, 156, 182, 210, 240, 272, 306, 342, 380, 420, 462, 506, 552, 600, 650, 702, 756, 812, 870, 930, 992, 1056, 1122, 1190, 1260, 1332, 1406, 1482, 1560, 1640, 1722, 1806, 1892, 1980, 2070, 2162, 2256, 2352, 2450, 2550, ...

Thus for every number that is one more than a pronic number, there will always be an integer value of \(x\) to satisfy \(a^2=(a-1)^2+x^2+(x+1)^2\). Looking at the list of pronic numbers above, let's take 2550 as an example. We will then have:$$ \begin{align} 2551^2&=2550^2+x^2+(x+1)^2\\x^2+(x+1)^2+2550^2-2551^2 &=0\\x^2+x^2+2x+1 +5101 \cdot (-1) &=0\\2x^2+2x-5100 &=0\\(2x-100)(x+51) &=0 \\x&=50 \text{ or }-51\end{align}$$Thus, choosing the positive solution, we have \(2551^2=2550^2+51^2+50^2\).

Of course, only numbers that are not equal to 7 mod 8 can be represented as a sum of three squares and we find that \( 2551^2 \! \! \mod 8 \equiv 1\). In fact, this value of 1 holds for all such square numbers whose square roots are one more than a pronic number. Thus we can say that if \(n\) is a pronic number then  \( (n+1)^2 \! \! \mod 8 \equiv 1\). 

There's nothing earth shattering in these observations. The connection with pronic numbers caught my attention after watching the video and I thought I'd follow up on it. Of course, numbers like \(2551^2=6507601\) can be expressed as a sum of three squares in probably thousands of ways and the pattern described earlier is just one these.

Monday, 28 October 2019

Lagrange's Four-Square Theorem

Today's number of \(25775\), corresponding to my diurnal age, brought me into contact with Lagrange's Four-Square Theorem, also known as Bachet's Conjecture. To quote from Wikipedia, the theorem states that every natural number can be represented as the sum of four integer squares: $$p = a_0^2 + a_1^2 + a_2^2 + a_3^2$$where the four numbers \(a_0, a_1, a_2, a_3\) are integers. For illustration, 3, 31 and 310 can be represented as the sum of four squares as follows:$$\begin{align}
3 & = 1^2+1^2+1^2+0^2 \\[3pt]
31 & = 5^2+2^2+1^2+1^2 \\[3pt]
310 & = 17^2+4^2+2^2+1^2.
\end{align}$$ This theorem was proven by Joseph Louis Lagrange in 1770."

Historically, Wikipedia goes on to say that:
From examples given in the ''Arithmetica'' it is clear that Diophantus was aware of the theorem. This book was translated in 1621 into Latin by Claude Gaspard Bachet de Méziriac, who stated the theorem in the notes of his translation. But the theorem was not proved until 1770 by Lagrange. 
Adrien-Marie Legendre completed the theorem in 1797–8 with his Legendre's three-square theorem, by proving that a positive integer can be expressed as the sum of three squares if and only if it is not of the form \(4^k(8m+7)\) for integers \(k\) and \(m\). Later, in 1834, Carl Gustav Jakob Jacobi discovered a simple formula for the number of representations of an integer as the sum of four squares with his own Jacobi's four-square theorem. 
The formula is also linked to Descartes' theorem of four "kissing circles", which involves the sum of the squares of the curvatures of four circles. This is also linked to Apollonian gaskets, which were more recently related to the Ramanujan–Petersson conjecture.
Getting back to \(25775\), it turns out to be a member of OEIS A243580: integers of the form \(8k + 7\) that can be written as a sum of four distinct squares of the form \(m, m + 1, m + 3, m + 5\), where \(m == 2 \text{ (mod } 4) \). The particular value of \(m\) here is \(78\) so that we have:$$25775=78^2 + 79^2 + 81^2 + 83^2$$There are many proofs of the theorem and two are described in the Wikipedia article. They seem complicated and I haven't delved into them. However, what's of particular interest in the article is the number of ways in which a number can be represented as a sum of four squares, based on the sum (rather than the number) of divisors. There is a rule for the number of ways that a number can be written as a sum of two squares but this is based on powers of its prime divisors. The rule for the four squares is that the number is:
  • \(8\) times the sum of the divisors of the number if it is odd and 
  • \(24\) times the sum of the odd divisors of the number if it is even 
These numbers count squares in different positions and also include negative numbers. Thus the odd number \(1\), that has a sum of divisors equal to \(1\), has eight possible representations:
  • \(1^2+0^2+0^2+0^2\) with the 1 in four possible positions
  • \((-1)^2+0^2+0^2+0^2\) with the -1 in four possible positions
The number \(25775\) with a sum of \(31992\) would have a staggering \(8 \times 31992 = 255936\) possible representations as a sum of four squares. None of these representations would involve zero because \(25775\) cannot be expressed as a sum of two or three squares. It's easier to work initially with smaller numbers to begin with so let's take \(15 = 3 \times 5\) with a sum of divisors of \(24\). I've chosen \(15\) because it's equal to \(8 \times 1+7\) and thus cannot be represented as a sum of three squares. Thus \(15\) should have \(8 \times 24 = 192\) representations. This is indeed the case. However, if we don't regard different positions as being different, then there are only twelve arrangements. If we exclude negative numbers, there is only one arrangement: \(1^2+1^2+2^2+3^2\).

Moving on to \(23 = 8 \times 2+7\), there is again only one positive arrangement and that is \(1^2+2^2+3^2+3^2 \). With \(31 = 8 \times 3+7\), there are two positive arrangements: \(1^2+1^2+2^2+5^2\) and \(2^2+3^2+3^2+3^2\). Being primes, the sums of divisors of \(23\) and \(31\) are \(24\) and \(32\) respectively and so by Jacobi's theorem there are \(8 \times 24 =192\) and \(8 \times 32 = 256\) possible arrangements. It would seem that the theorem is of little practical use but interesting to explore nonetheless.

Saturday, 16 December 2017

Building Brilliant Numbers

I shouldn't let the opportunity go by to make a note of today and tomorrow's numbers: 25094 and 25095. Both these numbers belong to the OEIS sequence A108770: numbers n such that \(n^2 + (n+1)^2 \) is a brilliant number. The sequence proceeds:
3, 10, 15, 20, 27, 37, 59, 92, 105, 120, 152, 155, 175, 190, 215, 219, 242, 245, 254, 255, 277, 300, 302, 307, 325, 337, 362, 365, 370, 402, 415, 614, 930, 944, 987, 1049, 1059, 1112, 1192, 1204, 1210, 1220, 1265, 1312, 1344, 1360, 1374, 1449, 1460, 1504, 1527, ...
As can be seen, such numbers are relatively common. 92 is given as an example \( 92^2 + 93^2 = 17113 = 109*157 \) as both of its factors have three digits. 25094 is also in this sequence because \( 25094^2+25095^2 = 1259467861 = 23873×52757 \) but so also is 25095 because \( 25095^2+25096^2 = 1259568241 = 29401×42841 \). These consecutive pairs are relatively rare and those listed are (254,255), (4099,4100), (11159,11160), (25094, 25095), (31754,31755) and (40189,40190) with the conjecture that there are infinitely many of such pairs.

It's a bit of a wait until the next pair (31754 and 31755) but hopefully I'll be around to greet them.

Friday, 24 February 2017

Sums of Squares Revisited

My first post for this mathematics blog concerned the conditions required for a number to be expressible as the sum of two squares. The date was 26th September 2015. I thought I might start revisiting some of my earlier posts just to reacquaint myself with their content. Let's consider prime numbers first. 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.

In other words, if \(p\) is a prime, then \(p=x^2+y^2\) where \(x\) and \(y\) are integers, if and only if \(p \equiv 1 \pmod{4}\). Applied to my current day count of \(24799\) (a prime), we find that \(24799 \equiv 3 \pmod{4}\) and so it cannot be written as the sum of two squares. In fact, it cannot even be written as the sum of three squares because the number can be expressed in the form \(4^a(8b+7)\) with \(a=0\) and \(b=3099\). By Legendre's 3-square theorem, such a number cannot be expressed as a sum of three squares.

Primes that can be expressed as the sum of two squares are called Pythagorean Primes.

If the number is composite, none of its \(4k+3\) primes can have an odd exponent. For example, two days ago I was \(24797\) days old and this number factorises to \(137 \times 181\). Now \(137 \equiv 1 \pmod{4}\) and \(181 \equiv 1 \pmod{4}\), so there are no \(4k+3\) primes and thus the number is expressible as a sum of two squares (in two different ways as it turns out): \(24797=59^2+146^2=74^2+139^2\).

There is a reason that \(24797\) can be expressed as a sum of squares in two different ways. Remember that its factors \(137\) and \(181\) are both primes satisfying \(p \equiv 1 \pmod{4}\) and so each can be expressed as a sum of two squares. Specifically, \(137=4^2+11^2\) and \(181=9^2+10^2\). It can easily be shown that the product of two sums of squares is equal to a sum of squares in two different ways. Here is the demonstration: $$(a^2+b^2)(c^2+d^2)=(ac-bd)^2+(ad+bc)^2=(ac+bd)^2+(ad-bc)^2$$There is an interesting history attached to this identity:
It is actually first found in Diophantus' Arithmetica (III, \(19\)), of the third century A.D. It was rediscovered by Brahmagupta (\(598\)–\(668\)), an Indian mathematician and astronomer, who generalised it (to the Brahmagupta identity) and used it in his study of what is now called Pell's equation. His Brahmasphutasiddhanta was translated from Sanskrit into Arabic by Mohammad al-Fazari, and was subsequently translated into Latin in \(1126\). The identity later appeared in Fibonacci's Book of Squares in \(1225\). Source.
However, take yesterday's number \(24798=2 \times 3 \times 4133\). Clearly, \(3\) is a \( 4k+3\) prime raised to an odd power and so \(24798\) cannot be expressed as sum of two squares. As it happens, \(4133 \equiv 1 \pmod{4}\) but that doesn't matter because \(3\) has already ruined things.

Friday, 6 May 2016

Numbers That Are Sums of Two Squares

Today I turned 24505 days old and was surprised to find the following information about this number:


In all the time that I've been analysing my daily numbers, this was the first time that I'd seen the number being representable by the sum of the squares of six different pairs of numbers. Similarly, I'd not seen a number being the hypotenuse of four different Pythagorean triples. It lead me to think whether this was a record of some sort.

Well, a little research shows that this is certainly not the case. For example, the first numbers that are representable as the sum of the squares of six different pairs of numbers are:

5525, 9425, 11050, 12025, 12325, 13325, 14365, 15725, 17225, 17425, 18785, 18850, 19825, 21125, 22100, 22525, 23725, 24050, 24505, 24650, 25925, 26650, 26825, 27625, 28730, 28925, 29725, 31025, 31265, 31450, 31525, 32045, 32825, 34450, 34645, 34850

There are numbers that are representable as the sum of the squares of seven different pairs of numbers but the first such number is 105625. Numbers that are representable as the sum of the squares of eight different pairs of numbers are interestingly far more common than seven and begin thus:

27625, 32045, 40885, 45305, 47125, 55250, 58565, 60125, 61625, 64090, 66625, 67405, 69745, 77285, 78625, 80665, 81770, 86125, 87125, 90610, 91205, 94250, 98345, 98605, 99125, 99905, 101065, 107185, 110500, 111605, 112625, 114985, 117130, 118625

71825, 93925 and 122525 are the first three numbers that are representable as the sum of the squares of nine different pairs of numbers. Of numbers that are representable as the sum of the squares of ten different pairs of numbers, the first is 138125. The OEIS doesn't give any results for 11 onwards but there's no reason to not suppose that numbers exist that are representable as the sum of the squares of eleven different pairs of numbers and beyond.

Let's summarise the results:
  1. 5
  2. 65
  3. 325
  4. 1105
  5. 8125
  6. 5525
  7. 105625
  8. 27625
  9. 71825
  10. 138125
I won't deal here with the numbers n for which n^2 can be represented as the sum of squares of different pairs of numbers, in other words n forms the hypotenuse of a Pythagorean triple. However, a similar analysis is possible.