Problems & Puzzles: Puzzles

Problem 88. Follow-up to problem 63

We already know an example of a 3x3 magic square of 7 squares and two more integers non-squares or non-triangular, By Andrew Bremner.
provided by C. Boyer in his "Unsolved problem" section,

See my Problem 63, from Jan 2016.
 

373² 289² 565²
360721 425² 23²
205² 527² 222121


360721 is NS & NT because 260721 = 137 x 2633 &  8*360721+1=2885769 = 3^2 × 311 × 1031 is NS
222121 is NS & NT because 222121 = 151 × 1471 & 8*222121+1=176969 = 3^2 × 197441 is NS

where NT means "Non Triangular" and NS means "Non Square".

Then, Arkadiusz Wesolowski sent by email on August 8, 2023, a way to construct a 3x3 magic square with a mix of 7 distinct square and one triangular number,
starting form the previous magic square shown above.

According to him:

"it is enough to find an integer solution to x^2 - n*y^2 = 1, where n = 1776968 = 8*222121 or n = 2885768 = 8*360721.
For example:
x = 22632419659503, y = 16978181966 is a solution to x^2 - 1776968*y^2 = 1,
x = 86286108053753141137230600854902563, y = 50793737929709259543442603308701 is a solution to x^2 - 2885768*y^2 = 1.

You get a 3x3 magic square which contains 7 distinct squares and one triangular integer if you multiply the numbers in the above
mentioned 3x3 magic square of 7 squares by 16978181966^2 or by 50793737929709259543442603308701^2."

No more explanation was given by Wesolowski neither a clue why his method works as it does.

So, by my side, I only made the calculations just to verify his claims.

My Calculations:

a) Multiplying by 16978181966^2 = 288258662870607625156

373² 289² 565²
360721 425² 23²
205² 527² 222121
     
     
139129 83521 319225
360721 180625 529
42025 277729 222121
     
Multiplying by 16978181966^2 = 288258662870607625156  
     
40105139506524768280329124(S) 24075651781616019460654276(S) 92019371654869719140424100(S)
103980953129348453153897476(NT) 52066720981003502293802500(S) 152488832658551433707524(S)
12114070307137285447180900(S) 80057790180390985126950724(S) 64028302455482236307275876(T)
     
     
6332861873318^2 4906694588174^2 9592672810790^2
103980953129348453153897476(NT) 7215727335550^2 390498185218^2
3480527303030^2 8947501896082^2 64028302455482236307275876=T(11316209829751)

b) Multiplying by 50793737929709259543442603308701^2 = 2580003812871985095788034614931298168930573016056159072702307401

373² 289² 565²
360721 425² 23²
205² 527² 222121
     
     
139129 83521 319225
360721 180625 529
42025 277729 222121
     
     
Multiplying by 50793737929709259543442603308701^2 = 2580003812871985095788034614931298168930573016056159072702307401  
     
358953350481066414391893467940776582945141693150877355625999326393729(S) 215484498454881067185312439073676954367250388874026461911169416438921(S) 823601717164059442202935349951443657976862171050527379983394080084225(S)
930661555382995335737755634332632806794805228924793756864249027996121(NS) 466013188700002307926713752321965731763084751025143732506854274305625(S) 1364822017009280115671870311298656731364273125493708149459520615129(S)
108424660235945173650492154692487805549307330999760085030314468527025(S) 716541878945123548668115065570254509158919113176261003102539132172329(S) 573073026918938201461534036703154880581027808899410109387709222217521(NS)
     
     
18946064247781553809704091034145473^2, 14679390261685976008054912356214589^2 28698461930285731642045070869416065^2
T(43143054026876570568615300427451281) 21587338620126435305963106406197925^2 1168255972383312969499179876100123^2
10412716275590398206405733678283705^2 26768299888956779779394251943685427^2 573073026918938201461534036703154880581027808899410109387709222217521( N$ & NT)

Q1. Can you explain why this method works as it does?

Q2. Can you get smaller solution than the provided by Wesolowski.

Q3. Can this method be used recursively and finally get a 3x3 magic square with 7 squares and two Triangular integers?


Week 9-16 Set 2023. Contributions came from Jan van Delden, Alessandro Casini, Emmanuel Vantieghem

***

Jan wrote:

If we multiply each entry with any square, then the squares turn into squares and we obtain a scaled version of the magic square.

The only way to obtain a triangular number, having the form t(t+1)/2, is to multiply one of the two remaining nonsquares, say s, with a square, say y^2. This means that we have to solve the equation

 

sy^2=t(t+1)/2

 

Multiply with 8 and reorganize

 

8sy^2=4t^2+4t

 

Which we may rewrite as

 

(2t+1)^2-8sy^2=1

 

This is a Pell’s equation which is known to have an infinite number of solutions, if 8s is not a square, or which is the same condition 2s is not a square. One may find the smallest solution (2t+1,y) with both 2t+1,y larger than 0 by using the convergent h/k of the regular continued fraction of sqrt(8s) for which h^2-8k^2=1; h is always odd, so we may retrieve t.

 

For s=222121 we’ll find (h,k)=(22632419659503,16978181966), as given, belonging to a convergent having index 19. And find t=(h-1)/2.
For s=360721 we’re not so lucky, the convergent has index 45 (which also explains the rather large values of (h,k).

 

This smallest positive solution (h,k) is called the fundamental solution to the Pell’s equation, lets call this (h[1],k[1]). All other solutions where (h[n],k[n]) are positive can be found by

 

h[n]+k[n]*sqrt(8s)=(h[1]+k[1]*sqrt(8s))^n[/math]

 

where we consider numbers in the ring of integers Z[sqrt(8s)] in which numbers have the form a+b*sqrt(8s) where a,b are integer.

 

As a recurrence equation it states

 

h[n]+k[n]*sqrt(8s)=(h[n-1]+k[n-1]*sqrt(8s))(h[1]+k[1]*sqrt(8s))

 

And if we expand we find

 

h[n]=h[n-1]h[0]+8s k[n-1]k[0]
k[n]=h[n-1]k[0]+k[n-1]h[0]

 

from which we obtain all solutions, given a fixed value of s such that 2s is not a square. This answers Q1 and the answer to Q2 is thus no.

 

If we are to find a solution (h,k) for two distinct values s, say s[a],s[b], then this has to be a solution to the system of equations

 

h^2-8s[a]k^2=1, h^2-8s[b]k^2=1

 

Subtract both equations and we find that

 

8(s[b]-s[a])k^2=0

 

This equation only has solution k=0, since s[a] and s[b] are distinct. The answer to Q3 is thus no.

 

 

Extra information.

 

This ring Z[\sqrt(n)], where n is not a square, is equipped with a norm N(a+bsqrt(n))=(a+b sqrt(n))(a-b sqrt(n))=a^2-nb^2. The numbers a+b sqrt(n) such that this norm equals 1 are called units. Those are the numbers we are interested in!

 

On Continued fraction - Wikipedia you may find an example where a simple/regular continued fraction is found for a real number. We may proceed likewise for a real number of the form sqrt(8s), the exception being, that in our case the continued fraction will not terminate but is periodic. Check that sqrt(7)=[2;1,1,1,4,…] where the last 4 numbers repeat (this is called the repetend).

 

There is also a section that explains how you may compute the convergents h/k, given this representation [2;1,1,1,4,…]. These convergents have a special property, these are the fractions that are the best approximations to a real number x, meaning that if h/k is an approximation then | x – a/b| > | x-h/k| for all b<k. (Given the denominator k, we can’t do better).

 

We know that we can’t find a positive solution to  a^2-nb^2=0, since n is supposed to be a nonsquare. Apparently we can find a solution h^2-nk^2=1. The fraction h/k must thus be very close to a solution of a^2-nb^2=0, that is h/k is an approximation to sqrt(n).

 

***

Alessandro wrote:

Q1. Arkadiusz’s method is simply finding a multiplicative constant (this move keeps the square still magic) such that the squares stay as such and furthermore one NS becomes a triangular number. For the former condition, this constant must be a square K^2. At the same time, NS*K^2 must turn into a triangular number, i.e. 8*NS*K^2+1 has to be a square. This is exactly the equation that comes out in Arkadiusz’s method, and it’s the famous Pell’s equation x^2-Dy^2=1, known to have an infinitely many distinct integer solutions for D no-square. Hence, a solution for NS= 222121 or 360721 will provide a magic square with 7 squares and 1 triangular number.

Q3. At first, we could try to find a constant K^2 in order to make 222121 and 360721 two triangular numbers at the same time, that is solving the system of the two Pell’s equation x^2-1776968*K^2=1 and x^2- 2885768*K^2=1. A simple brute-force approach shows that K must have more than 3 millions of digits. General systems of Pell’s equations are known to have at most 2 positive solutions, and their resolution is essentially equal to solving a series of Thue’s equations. In this case, with software PARI/GP and assuming GRH, one gets this system doesn’t have a positive solution, so it’s most likely that such constant K^2 doesn’t exist. It’s also possible to prove or disprove that statement with certainty, without assuming the GRH, but it requires much more computational time. One could try to apply the method recursively, but after having multiplied for the first value one must solve in any case a system of Pell’s equation, one to make the other NS a T number and one to keep the T just obtained as such, with the new huge square’s entries. I haven't looked into it further, but I believe the ending is the same. Summing the answer up, it’s almost certainly not possible.

***

Emmanuel wrote:

Q1.
If  n  is an arbitrary positive integer then it is always possible to find an integer  y  such that  n*y^2 is a triangular number.
Indeed, n*y^2  is a triangular number if and only if  8*n*y^2 + 1 is a square number, say :  x^2.
Thus, we simply have to find all those  y  in solving the Pell equation :
        x^2 - 8*n*y^2 = 1.
So, if you have a magic square  M with seven squares, and a non-square number  n  in it you will find
that the magic square  M  multiplied with  y^2 (i. e. : multiplying all elements of  M  by  y^2)
will give a magic square with seven squares and one triangular number.,exactly what Arkadiusz proposed.

Q2.
No smaller example exists.  Arkadiusz used the smallest possible  y  in both cases.

***

Records   |  Conjectures  |  Problems  |  Puzzles