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

Saturday, 27 July 2024

Special Sums of Squares

There are many positive integers \(n\) with the property that:$$n=x^2+y^2$$where \(x\) and \(y\) are integers but how frequent are integers with the additional property that \(x\) and \(y\) are both different but share the same digits. The first example of such a number is:$$585 = 12^2+ 21^2$$In fact, up to 40000, there are 51 such numbers. They are:

585, 1130, 1553, 1877, 2340, 2826, 3005, 3329, 3977, 4034, 4520, 4941, 5265, 5330, 5913, 6212, 6698, 6885, 7361, 7508, 7685, 8333, 8642, 8874, 9305, 9360, 10170, 10265, 10589, 11237, 12020, 12506, 13653, 13977, 15650, 17525, 22301, 24804, 27185, 27509, 29930, 30416, 32553, 32877, 33525, 35540, 36026, 36836, 38405, 38729, 39377

Here is a permalink that will generate these numbers and their factorisations. The sequence is not listed in the OEIS. I was drawn to investigate the frequency of these sorts of numbers because the number associated with my diurnal age today, 27509, has this property:$$27509=103^2+130^2$$The number also has the property that the difference of 130 and 103 is 27, a cube, and this qualifies the number for membership of OEIS  A282405:


 A282405



Primes \(p = x^2 + y^2\) such that \(x - y \) is a cube greater than one.



The initial members of the sequence are (permalink):

977, 1049, 1289, 1877, 2477, 2609, 3329, 4877, 5669, 6089, 6977, 8429, 9209, 9749, 10589, 12377, 12689, 13649, 15329, 15877, 16657, 17477, 18617, 18913, 19213, 20773, 21377, 21757, 22093, 22433, 22777, 23833, 23909, 25229, 25673, 26053, 26437, 27509, 30497

The first member of this sequence, 977, has the property that:$$ 977=31^2+4^2\\ \text{where } 31-4=27=3^3$$Of course, the difference need not be a cubic number. It could be a square number. In such case, the numbers belong to OEIS A282406:


 A282406

Primes \(p = x^2 + y^2\) such that \(x - y\) is a square greater than one.



The first member of the sequence is 101 with the property that:$$101=10^2-1^2\\ \text{where }10 -1 = 9 =3^2$$This sequence of numbers in not in the OEIS. The 152 initial numbers, up to 40000, are (permalink):

101, 353, 461, 521, 653, 677, 733, 857, 881, 997, 1153, 1237, 1553, 1613, 1901, 2053, 2153, 2297, 2557, 2693, 2713, 2833, 3061, 3313, 3433, 3581, 3593, 4001, 4013, 4273, 4481, 4637, 4813, 5413, 5981, 6037, 6101, 6301, 6473, 6653, 7121, 7393, 7793, 7853, 7877, 8377, 8521, 8893, 9013, 9157, 9221, 9521, 9697, 9781, 9973, 10253, 10313, 10601, 10861, 11093, 11117, 12301, 12601, 12637, 12941, 12953, 13001, 13597, 13841, 14321, 14593, 14813, 15277, 15641, 15901, 16061, 16333, 16421, 16433, 16693, 16981, 17581, 18313, 18553, 18593, 19301, 19333, 19441, 19661, 19717, 19841, 19961, 20113, 20393, 21001, 21401, 21521, 21601, 21737, 21881, 22153, 22573, 23041, 23081, 23857, 24733, 25121, 25541, 25561, 25621, 26261, 26393, 26513, 26993, 27457, 27653, 27701, 28813, 28901, 29501, 29581, 29761, 29837, 30241, 30661, 30817, 30893, 31393, 31541, 31741, 32141, 32321, 32633, 33581, 33713, 34781, 34897, 35153, 36313, 36493, 36541, 36761, 36821, 37853, 38261, 38321, 38393, 38677, 38821, 39233, 39461, 39521

The algorithm is easily modified to accommodate other roots. We need not restrict ourselves to differences. What about sums? Let's consider:

Primes \(p = x^2 + y^2\) such that \(x + y\) is a square greater than one.

The first example of such a number is:$$53=2^2+7^2\\ \text{where }2+7=9=3^2$$There are 83 such numbers in the range up to 40000. They are (permalink):

53, 317, 337, 353, 373, 397, 457, 577, 1213, 1381, 1621, 2213, 3461, 3593, 3701, 3761, 4481, 4793, 5021, 5393, 5801, 7333, 7433, 7541, 7741, 7933, 8081, 8161, 8521, 9181, 9433, 10133, 10601, 11833, 12421, 13933, 14293, 14321, 14341, 14401, 14461, 14593, 15121, 15581, 16141, 16661, 17093, 17401, 18793, 19181, 19381, 19793, 20441, 21601, 22093, 22861, 24793, 25373, 25457, 25577, 25733, 25793, 25997, 26153, 26237, 26293, 26417, 26513, 26717, 26921, 27241, 27893, 28277, 28433, 29453, 31253, 32633, 33377, 33893, 34157, 35537, 36713, 38273

Similarly we could consider numbers such as:

Primes \(p = x^2 + y^2\) such that \(x + y \) is a cube greater than one.

The first example of such a prime is:$$389=10^2+17^2\\ \text{where }10+17=27=3^3$$The sequence of such numbers is not in the OEIS. There are 27 such numbers in the range up to 40000. They are (permalink):

389, 449, 509, 677, 7817, 7853, 7873, 7993, 8233, 8293, 8573, 8737, 9013, 9437, 10193, 10333, 10477, 11093, 11257, 11597, 11953, 12517, 12713, 13537, 14197, 14657, 15377


Wednesday, 24 May 2023

That Number Again

The number associated with my diurnal age today, 27079, is a member of OEIS  A133562:


  A133562

Numbers which are the sum of the squares of seven consecutive primes.   
  


In the case of 27079, the primes are as shown below (permalink):$$47^2+ 53^2+ 59^2+ 61^2+ 67^2 +71^2+ 73^2 = 27079$$However, it is the very first term in this sequence that is most interesting as it is the number 666:$$2^2+3^2+5^2+7^2+11^2+13^2+17^2=666$$It is the only even number in the sequence because it includes the even square \(4=2^2\). I naively thought that it might be possible to arrange these squares to form an \(18 \times 37\) rectangle but I was swiftly disabused of this notion when I recalled a post called Squaring the Square that I'd made on January 29th 2021.

In this post, I note that the smallest square that can be constructed of smaller squares of unequal size requires 21 squares and has a side of 112 units. The smallest rectangle than can be constructed from smaller squares of unequal size requires 9 squares and has dimensions of \(32 \times 33 \) units. Clearly then a rectangle of dimensions \(18 \times 37\) cannot be constructed from only seven unequal squares.

However, I did find a decomposition of the square of side 666 into 26 smaller squares of unequal size. These squares have the following sides: 2, 3, 8, 33, 36, 55, 65, 69, 89, 90, 97, 102, 105, 107, 109, 111, 120, 129, 132, 171, 175, 185, 186, 220, 230, 261. See Figure 1.


Figure 1: decomposition of square of side 666 (source)

This square of side 666 units has an area of 443556 square units. So just an interesting little diversion with the result that:$$2^2+ 3^2 + \dots + 230^2+ 261^2 = 666^2$$

Thursday, 8 November 2018

2019: A Numerical Profile


With the coming year, 2019, less than two months away, I decided to investigate some of the numerical properties adhering to this number. Right off the bat, we can see that its digit sum is 12 and, because 3 divides 12, we know that 3 will divide 2019 as well. In fact, 2019 has prime factors of 3 and 673. Thus

2019 = 3 * 673

This means that 673 AD and 1346 AD (673 + 673 = 1346) could be associated with 2019 AD. 673 AD was a time of great expansion for the Islamic world (Muhammad had died in 632 AD). The following year, the Siege of Constantinople (one of many over the centuries) began, but "in 672–673 Arab fleets secured bases along the coasts of Asia Minor, and then proceeded to install a loose blockade around Constantinople." Here are some more details :
The First Arab Siege of Constantinople in 674–678 was a major conflict of the Arab–Byzantine wars, and the first culmination of the Umayyad Caliphate's expansionist strategy towards the Byzantine Empire, led by Caliph Mu'awiya I. Mu'awiya, who had emerged in 661 as the ruler of the Muslim Arab empire following a civil war, renewed aggressive warfare against Byzantium after a lapse of some years and hoped to deliver a lethal blow by capturing the Byzantine capital, Constantinople.
As reported by the Byzantine chronicler Theophanes the Confessor, the Arab attack was methodical: in 672–673 Arab fleets secured bases along the coasts of Asia Minor, and then proceeded to install a loose blockade around Constantinople. They used the peninsula of Cyzicus near the city as a base to spend the winter, and returned every spring to launch attacks against the city's fortifications. Finally, the Byzantines, under Emperor Constantine IV, managed to destroy the Arab navy using a new invention, the liquid incendiary substance known as Greek fire. The Byzantines also defeated the Arab land army in Asia Minor, forcing them to lift the siege. The Byzantine victory was of major importance for the survival of the Byzantine state, as the Arab threat receded for a time. A peace treaty was signed soon after, and following the outbreak of another Muslim civil war, the Byzantines even experienced a period of ascendancy over the Caliphate.
1346 AD was also an interesting year. As reported in Wikipedia, it included these events:
  • in Spring, a severe Black Death epidemic began its spread at the River Don near the Black Sea, then spread throughout Russia, the Caucasus, and the Genovese provinces within the year
  • on April 16th,  the Serbian Empire was proclaimed in Skopje by Dusan Silni, occupying much of South-Eastern Europe
  • on July 11th and 12th, Edward III and the English army cross the English Channel, and begin an invasion of France
  • on August 26, at the Battle of Crécy, the English defeat the French, in the first European battle where gunpowder is used.
Well, there's not much Mathematics in the history above so best to move on to more mathematical matters. What follows are some interesting facts about 2019 as number.

OEIS A037015: Numbers n with property that, reading binary expansion of n from right to left, run lengths strictly increase. Here we have \( 2019_{10}=11111100011_2 \). The initial members of the sequence are:

0, 1, 3, 6, 7, 14, 15, 28, 30, 31, 57, 60, 62, 63, 120, 121, 124, 126, 127, 241, 248, 249, 252, 254, 255, 483, 496, 497, 504, 505, 508, 510, 511, 966, 993, 995, 1008, 1009, 1016, 1017, 1020, 1022, 1023, 1987, 1990, 2016, 2017, 2019, 2032, 2033, 2040, 2041, 2044

OEIS A158339: Semiprimes that are the sum of four successive semiprimes. Here we have: 501 + 502 + 505 + 511 = 2019 and 501 = 3 * 167, 502 = 2 * 251, 505 = 5 * 101 and 511 = 7 * 73.

The initial members of this sequence are:

39, 94, 106, 118, 146, 158, 185, 201, 221, 254, 302, 365, 427, 473, 485, 519, 537, 589, 633, 655, 707, 723, 749, 767, 842, 851, 869, 901, 1003, 1145, 1205, 1211, 1219, 1247, 1263, 1337, 1349, 1603, 1646, 1681, 1703, 1731, 1797, 1891, 1903, 1937, 2005, 2019

OEIS A193227: Semiprimes p*q such that p+1 and q+1 are semiprimes. 

Here p+1 = 4 = 2 * 2 and q+1 = 674 = 2 * 337 and the initial members of this sequence are:

9, 15, 25, 39, 65, 111, 169, 183, 185, 219, 305, 365, 471, 481, 579, 785, 793, 831, 939, 949, 965, 1191, 1263, 1369, 1371, 1385, 1565, 1623, 1839, 1983, 1985, 2019

OEIS A091431: Happy-go-Lucky numbers: numbers that are both Happy (OEIS A007770) and Lucky (OEIS A000959). Happy numbers are those whose repeated sums  of squares of digits return 1.

The initial members of this sequence are:
1, 7, 13, 31, 49, 79, 129, 133, 193, 219, 319, 331, 367, 391, 409, 487, 655, 673, 739, 931, 937, 1009, 1029, 1039, 1093, 1209, 1233, 1251, 1275, 1281, 1285, 1303, 1309, 1323, 1339, 1533, 1575, 1587, 1599, 1663, 1771, 1857, 1933, 1959, 1995, 2019

OEIS A076408: Sum of first n perfect powers. As Wikipedia defines it: 
In mathematics, a perfect power is a positive integer that can be expressed as an integer power of another positive integer. More formally, n is a perfect power if there exist natural numbers m > 1, and k > 1 such that \( m^k = n \). In this case, n may be called a perfect k-th power. If k = 2 or k = 3, then n is called a perfect square or perfect cube, respectively. Sometimes 1 is also considered a perfect power (\(1^k = 1\) for any k).
Here n=22 and, as shown in OEIS A001597, the first 22 perfect powers are: 1, 4, 8, 9, 16, 25, 27, 32, 36, 49, 64, 81, 100, 121, 125, 128, 144, 169, 196, 216, 225, 243 with the sequence of progressive sums being: 1, 5, 13, 22, 38, 63, 90, 122, 158, 207, 271, 352, 452, 573, 698, 826, 970, 1139, 1335, 1551, 1776, 2019.

In fact, there are 140 sequences listed in the OEIS that contain a reference to 2019. I've covered some of the more interesting ones, or at least ones that I could understand.

From Numbers Aplenty, we have the following properties:

2019 is the smallest number that can be written in six ways as the sum of the squares of three primes. Here are the prime triplets:

7 11 43, 7 17 41, 11 23 37, 13 13 41, 17 19 37, 23 23 31

Figure 1 is an extract from the Numbers Aplenty page:

FIGURE 1

Sunday, 15 April 2018

Sum of Squares of Integers and Catalan Numbers

As I began reading a new book Catalan Numbers With Applications by Thomas Koshy, I hadn't progressed far before I came across the statement:$$ \sum_{k=1}^n k^2=\frac{n(n+1)(2n+1)}{6}$$At this point, I had to pause because the author had just assumed this result but I couldn't see how to prove it. I needed to do a little digging but before long I came across an interesting proof of the result on this site. The website starts slowly and works out firstly what the sum of the first n integers will be. Here is how it is worked out: $$ \begin{align} (k-1)^2&=k^2-2k+1\\ \text{Rearranging the terms as below:}\\k^2-(k-1)^2&=2k-1\\ \text{Now sum both sides:}\\ \sum_{k=1}^n (k^2-(k-1)^2)&=2 \sum_{k=1}^n k-\sum_{k=1}^n 1\\n^2&=2S_n-n\\S_n&=\frac{n^2+n}{2}\\&=\frac{n(n+1)}{2} \end{align} $$ After this the website goes on to tackle the sum of the squares of the first n integers as follows (using a similar approach): $$\begin{align} (k-1)^3&=k^3-3k^2+3k+1\\ \text{Rearrange the terms: }\\k^3-(k-1)^3&=3k^2-3k-1\\ \text{Summing both sides:}\\ \sum_{k=1}^n (k^3-(k-1)^3)&=3 \sum_{k=1}^n k^2-3 \sum_{k=1}^n k -\sum_{k=1}^n 1\\n^3&=3 \sum_{k=1}^n k^2 -3 \frac{n(n+1)}{2}-n \\ \sum_{k=1}^n k^2&=\frac{1}{3}n^3+\frac{1}{2}n^2+\frac{1}{6}n\\&=\frac{n(n+1)(2n+1)}{6} \end{align}$$ The website then goes on to establish a general result for the sum of integers raised to any power. The question is asked is there a formula for calculating: $$ 1^a+2^a+3^a+ \cdots + (n-1)^a + n^a=\sum_{k=1}^n k^a \text{ ?} $$Well there is, it's called Faulhaber's Formula and involves Bernoulli numbers but I won't go into that here.

For now, I can go on reading my book about the Catalan numbers. I first made a blog post about Catalan numbers back in 2015 on Tuesday the 29th September. This was the first time I'd really heard of them and I didn't delve deeply into them at all in that post. Hopefully I'll have more to say in later posts about these numbers.

The Catalan numbers are of the form: \( \dfrac{1}{n+1} \dbinom{2n}{n} \)

They can be calculated readily enough:
  • in WolframAlpha using catalannumber[n]
  • in SageMath using catalan_number(n)
Talking of SageMath, I've installed the latest version (8.1) on my Mac and am making a concerted effort to make more use of it. I first made a blog post about this free, open source software program in 2017 on the 4th of January. It really is quite impressive in its capabilities so hopefully I can become more adept at using it. Here's a screenshot from my SageMath notebook:


Lastly, the mathematician who lent his name to these numbers, Eugène Catalan, shouldn't be ignored. He was born on the 30th of May 1814 in Bruges, French Empire (now Belgium) and died on the 14th February 1894 in Liège, Belgium. A biography can be found at MacTutor History of Mathematics archive along with biographies of a great many other mathematicians and other interesting material. I first came across this archive in the early naughties and was fascinated to read about the lives of famous mathematicians who had lent their names to so many mathematical tools that I'd used in previous years. L'Hôpital's Rule was a case in point. Although widely used and a greatly useful mathematical tool, who knows anything about the impressively named Guillaume François Antoine Marquis de L'Hôpital who lent his name to the rule?

on Sunday, March 28th 2021
layout improved

Tuesday, 20 February 2018

Fundamental Theorem on Sums of Two Squares

Today I achieved some further insights regarding what conditions allow a number to be expressed as a sum of two squares and then, if these conditions are met, to determine the number of ways in which this can be done. This useful site provided clear answers to these two matters. Firstly, the French mathematician Albert Girard had determined in 1632 (according to Leonard Dickson) that the numbers expressible as a sum of two integral squares were:
  • every square
  • every prime \( 4n+1 \)
  • a product formed of such numbers 
  • the double of one of the foregoing
The fundamental theorem on sums of two squares is:

Let \(n=2^kp_1^{a_1} \dots p_r^{a_r}q_1^{b_1} \dots q_s^{b_s}\) , where the \( p_i  \) are distinct primes with \( p_i \equiv 1 \pmod{4} \) and the \( q_i \) are distinct primes with \( q_j \equiv 3 \pmod{4} \). Then \(n \) is the sum of two squares if and only if all the \( b_j \) are even. In that case, the number of distinct solutions is \( \lceil \frac{\scriptstyle{1}}{\scriptstyle{2}} (a_1+1)(a_2+1) \dots (a_r+1) \rceil \), where \( \lceil x \rceil \) is the ceiling function, the smallest integer greater than or equal to \( x \).

What's of particular interest here is that the number of distinct solutions can be calculated. For example, consider the number \( 5^2 \times 13 \times 17 \times 29 = 160225 \) which can be represented as a sum of two squares because all the prime factors are of the form \( 4k+1 \). The number of distinct solutions can be found by adding 1 to all the indices of the factors, multiplying them together and dividing by 2. This gives \( 3 \times 2 \times 2 \times 2 \) divided by 2 which is 12. So there are twelve distinct ways in which this number can be expressed as a sum of two squares. 

The two square calculator provided at the site mentioned earlier displays eleven of these but oddly enough misses out on a twelfth arrangement, namely \( 300^2+265^2 \):

In determining what is the smallest number expressible as the sum of two different squares in two, three, four ways and so on, the \( 4k+1 \) primes are the key. These primes are 5, 13, 17, 29, 37, 41, ... and so the smallest number to be expressible on the sum of two squares in two different ways is 65 = 5 x 13, viz. \( 8^2+1^2 \text{ and } 7^2 + 4^2 \). Of course, I'm ignoring 25 which can be written as \( 3^2+4^2 \text{ and }0^2+5^2 \) because I'm only considering positive integers here. Similarly, the smallest number expressible as the sum of two squares in three different ways is 325 = 5 x 5 x 13:


Throwing 2's or 4k+3 primes into the factorisation doesn't increase the number of ways in which the number can be written as a sum of two squares. For example, 650 = 2 x 5 x 5 x 13 = 2 x 325 is still only expressible in three different ways:


It follows of course that every 4k+1 prime is expressible as a sum of two squares in one way only. For example, my birth year is \( 1949=10^2+43^2 \). My most recent prime day was \( 25153=57^2+148^2 \) and so it goes.