Subscribe to RSS feed

New way to construct Magic Square of squares.

Success

About Thomas' mathematical adventures:

I have a passion for recreational mathematical puzzles. Especially combinatorical puzzles or puzzles involving square numbers. My approach is normally some mathematical research combined with brute force CPU power. Often I am not able to solve the puzzle, but sometimes I am. However even when I fail to find a solution the information gained can be interesting since it can reveal the minimum size of a solution or revealing patterns in the numbers. This is the third adventure in my series of 'mathematical adventures', and this adventure was a success!

Abstract:

This page has been updated after it was accepted as an IBM Ponder This challengeIBM Ponder This January 2019

This puzzle was discovered by myself while working on another puzzle. The original puzzle I was trying and still trying solve is proving or disproving existance of an Magic Square of order 3 having only squares as entries. In short a Magic Square of order n is a n*n matrix having different natural numbers in each cell in such the sum of the numbers in each row, each column and both of the two diagonals adds the the same number. However there are no intersting puzzles about Magic Squares just having natural numbers, since they are easy to construct. They exist for order 3 or higher, but not for order 2. But making the restriction that all entries in the Magic Square must be square numbers opened up for a lot of interesting problems, where all but one are solved. This is what is meant by "Magic Squares of squares". Describing and tracking these problems and updates is done by Christian Boyer on his homepage about Magic Squares. See the Magic Square of squares of order 4 to the right for an example. The holy grail in recreational mathematics is the existance of an Magic Square of order 3, but that is not what I am going to solve here.

One way to make Magic Squares is by using Mutually Orthogonal Latin Squares(MOLS). I already used MOLS in Thomas Mathematical Adventures Part 2. This way you can construct 'normal' Magic Squares. So I wondered if this same method could be used to construct Magic Squares of Squares as well? This methods requires 3 or more MOLS of order n. So this exludes a solution for n=3,n=6 and n=10 though, since these order does not have 3 or more MOLS. The answer to my question was yes, for magic square of order 4 at least!

This approach is probably one of the hardest ways to construct a magic square of squares. But I wanted to see if it was possible, and if possible, you will be able to construct many different magic square of squares using a only very limited set of squares, making these square numbers really special.
Magic Square of Squares of order 4

The traditionally way to make (normal) Magic Squares using MOLS:

How to construct Magic Squares of order 7 using MOLS

I short you use the two sets {1,2,3,4,5,6,7} and {0,7,14,21,28,35,42} as elements for two MOLS and simply add the entries of the two MOLS(matix addition). The MOLS will make every pair from the sets will meet once, so the sum will be every integer from 1 to 49. So it is clear each column and sum will add to the total sum of the two sets which is 175. However it is not obvious why it also works for the two diagonals. But that is because there are 3 (or more) MOLS of size 7. And the last one (which we dont use) garanties the diagonals will work as well. But the numbers 1 to 49 are not squares so the construction only have a (normal) Magic Square. If I can make all combinations of pairs from the two sets add to a square, then I can create a Magic Square of Squares using MOLS!

Definition of Square Additive Sets:

Let A={a1,a2,...,an} and B={b1,b2,...,bm} be two sets of integers. If a+b is square for all a ∈ A and b ∈ B.
A and B are then said to be Square Additive Sets (SAS) and this is denoted by [a1,a2,...,an][b1,b2,...,bm]
An example of a 3*3 SAS is [0,165,480][4, 196, 676]. Etc. 165+196=381=192 a square. The same goes for the other 8 combinations of the two sets.

Results:

There is little mathematic theory about a problem of this kind and I could not find anything interesting myself. So "KIWI" (Kill It With Iron) aka brute force CPU attack was my next move as usual.
This problem was accepted as the IBM Ponder This challenge January 2019. Ponder This January 2019
Go ahead and try see if you can solve this challenge yourself!
If your program is somewhat efficient you can find a 4*4 solution in a few minutes.
Here is one of the solutions:
[0,622080,275968,2889513][1562, 5042, 11762, 15242]

From this solution and using two different MOLS of order 4 , you can then construct the following Magic Square of Squares, making this adventure a success already!

1562 9362 12882 22832
20672 16122 8042 5042
17162 11762 17732 5482
7282 17072 15242 14162
magic sum=7771465


But from the 4*4 SAS above you can just remove an element from each set and get a 3*3 SAS. You can get 16 different 3*3 SAS this way. This way you can make 16 different SEMI-magic square of squares of order 3. Semi-magic means the two diagonals are not adding to the magic sum. The reason for this is that there are only 2 MOLS of order 3. If there was 3 or more, the diagonal would also add to the magic sum. But it is still incredible to make so many different semi Magic Squares of squares from just using the original 16 square numbers from the Magic Square of squares above. And notice each one is really different, noone uses the exact same 9 square numbers.

1562 9362 12882
1416 2 5482 5042
7282 11762 8042
1562 9362 16122
17162 5482 5042
7282 15242 8042
1562 14162 16122
17162 5482 11762
12882 15242 8042
5042 14162 16122
1716 2 7282 11762
12882 15242 9362
1562 9362 20672
14162 17072 5042
17732 11762 8042
1562 9362 22832
17162 17072 5042
17732 15242 8042
1562 14162 22832
17162 17072 11762
20672 15242 8042
504 2 14162 22832
17162 17732 11762
20672 15242 9362
1562 7282 20672
12882 17072 5042
17732 11762 5482
1562 7282 22832
16122 17072 5042
17732 15242 5482
1562 12882 22832
16122 17072 11762
20672 15242 5482
5042 12882 22832
16122 17732 11762
20672 15242 7282
8042 7282 20672
12882 17072 9362
17732 14162 5482
8042 7282 22832
16122 17072 9362
17732 17162 5482
8042 12882 22832
16122 17072 14162
20672 17162 5482
936 2 12882 22832
16122 17732 14162
2067 2 17162 7282

Imagine finding a 5*5 SAS. You could then create:
1 magic square of squares of order 5
25 magic squares of squares of order 4
100 semi-magic squares of squares of order 3.

And all these magic squares would only be using the 25 different squares and every of the would use a unique subset of them. Calling these 25 squares 'magic' would be a very good description indeed.


My algoritm:

Searching for solutions [a,b,c,d][e,f,g,h] having all numbers less than 106 gives a total of 1048 combinations(n8 complexity). So a stupid brute force CPU attack will be beyond futile. First notice that a solution is invariant under substracting a constant k from one of the arrays and adding it to the other. So you WLOG a solution will be of the form [0,b,c,d][e,f,g,h]. Next notice that the 0 in the first array now forces all the numbers in the second array to be squares, since the sum of them has to be a square. As the final WLOG result we can assume a SAS is of the form [0,b,c,d][e2,f2,g2,h2]. This is the most important observation for my algorithm.
The different between square numbers are increasing by 2. Etc. the square numbers 100,121,144,169 has step value 21,23,25 between them.
And lets say you start with A=[4,100] and B=[0] and want to find more elements for the set B. (A is the set with squares)
The restriction from '100' gives that candidates in B: are 21, 44, 69, 96,125,..,525,... (The sum of the step values)
At the same time the restriction for '4' gives candidates in B are: 5,12,21,32,45,60,77,96,...., 525,...
The intersections is 21,96,525.
You can calculate this intersection without finding all the numbers.
Also there is no need to go up further when the distance between square numbers are higher than (100-4)=96, since
then you can not add both 4 and 100 and get a square number, the gap between square numbers is too large. This gap happens at 49*49=2401, ( 49 = 1+96/2)
So now you have A=[4,100] and B=[0,21,96,525]. Now you can try to expand the set A, however this is not possible. So you can not get a 4*4 solution having [4,100] in the square set.
This was the major principle in my algorithm.
Having my program run for 1 week I found around 600 4*5 solutions, here is one of them:
[0, 6557625,13395456,19008000][4202, 27602, 45202, 73202, 162122] <-- 4*5 SAS
But I also found a single 4*6 solution
[0,16594560, 137675520, 1202947200][29882,43562,57872,111642,170462,239482] <-- 4*6 SAS
This solution was also found by those that earned ** for their solution to the IBM Ponder This puzzle.

Ambiguous representation of solutions

Deron Stewart noticed 4*6 and 6*4 solutions have a one-to-one correspondence, they are equivalent under the following transformation:
Given A = [a1, a2, a3, a4] B= [0, b1, b2, b3, b4, b5]
Subtract a1 from all the a’s and add a1 to all the b’s. Now all the b’s are squares (with b1’ = a1) and a1’=0, so we have transformed a 4*6 solution into a 6*4 solution. The a+b sums remain unchanged.
In order to represent solutions uniquely I list them in the form with 6 numbers in the square set. This makes their representation shorter as you can list the 6 numbers as squares.

Compact representation of SAS:

Uoti Urpala suggested a even shorter representation of the solutions which I will call the 'compact form'. In the sets with the non-squares, we know if we add the smallest square from the square-set, then we will get a square as well. Doing this for the above 4*6 solution gives:
Compact notation: [2988, 5052, 12108, 34812] [2988, 4356, 5787, 11164, 17046, 23948]
The square has also been removed, since all numbers are now squared. But in this compact form you can no longer add a number from each set and get a square, you have to transform it back first.
But it has the major advantage is unambiguous except for the order of the two sets. So it is much easier to see if two solutions are the same and if it is primitive. A primitive solution can not be reduced to small by division of a common factor. The 2*2 solution [16,400][0, 84] is just a scalar of the primitive solution [4,100][0,21].
In compact form these two solutions would be [4,20][4,10] and [2,10][2,5].

All known primitive 4*6 solutions


This is a list of all known 4*6 primitive solutions in the compact form that was submitted to Ponder This January 2019 and who found it.

A B Finder
[1899, 42156, 140884, 473004][1899, 17613, 59373, 69837, 80109, 1279251]Uoti Urpala, Andreas Stiller
[2988, 5052, 12108, 34812][2988, 4356, 5787, 11164, 17046, 23948]Thomas Egense,Uoti Urpala, Jess Thrysøe, Andreas Stiller, Deron Stewart,Dieter Beckerle, Vladimir Volevich,Tom Sirgedas
[3128, 273020, 1039720, 2292620][3128, 270453, 351645, 494872, 819672, 2893128]Uoti Urpala
[3264, 44760, 171960, 303060][3264, 68736, 122739, 135264, 223840, 493239]Uoti Urpala
[6587, 26712, 99288, 188712][6587, 22715, 56645, 133595, 199205, 272915]Uoti Urpala,Andreas Stiller
[6720, 37968, 64680, 139920][6720, 15855, 26880, 45440, 69510, 129290]Uoti Urpala,Andreas Stiller
[6765, 62304, 80160, 543840][6765, 58355, 168685, 225555, 233547, 494835]Uoti Urpala
[9696, 1488075, 3344800, 4689600][9696, 2884104, 3647196, 5467104, 7164996, 14409696]Uoti Urpala
[11160, 476532, 1328040, 2354760][11160, 375720, 473401, 659835, 928440, 1752120]Uoti Urpala
[13937, 124817, 187537, 1316623][13937, 24864, 139678, 588192, 938631, 4161696]Uoti Urpala,Andreas Stiller
[14280, 41580, 68376, 355320][14280, 26760, 31640, 67368, 100065, 136920]Uoti Urpala,Andreas Stiller
[14616, 73080, 127020, 370620][14616, 39384, 89784, 228375, 391384, 611784]Uoti Urpala,Andreas Stiller
[15400, 392140, 514360, 934640][15400, 231000, 299145, 548520, 835395, 951384]Uoti Urpala
[26112, 228480, 405888, 815388][26112, 160480, 261120, 294240, 606135, 1966560]Uoti Urpala
[32067, 807933, 11897067, 31782933][32067, 661500, 870660, 4550875, 27703620, 41773500]Uoti Urpala
[35468, 49357, 244468, 763532][35468, 91360, 119160, 176040, 450740, 794592]Uoti Urpala
[39564, 211596, 237204, 1579116][39564, 374976, 600768, 1214208, 1800356, 7912107]Uoti Urpala
[46800, 285168, 725400, 4396080][46800, 155376, 788560, 1496560, 1971450, 11439935]Uoti Urpala
[47898, 77052, 144477, 198180][47898, 60390, 113498, 197190, 381402, 508410]Uoti Urpala,Andreas Stiller
[60375, 3912300, 5268564, 37142700][60375, 1895775, 9232545, 16298345, 41052585, 69466785]Uoti Urpala
[63360, 98928, 235840, 628128][63360, 107205, 243180, 296604, 448896, 658560]Uoti Urpala
[68145, 718305, 4010415, 8550465][68145, 218505, 813330, 1108030, 3899742, 4026582]Uoti Urpala
[74640, 254640, 532692, 2753640][74640, 193200, 414925, 459760, 865200, 2092944]Uoti Urpala
[78579, 137421, 614579, 851571][78579, 130308, 179940, 212790, 326790, 625410]Uoti Urpala
[86240, 137360, 266560, 590920][86240, 116585, 283338, 436590, 548640, 949536]Uoti Urpala
[88212, 503463, 1147788, 5469588][88212, 324240, 335860, 1248240, 2078916, 4468940]Uoti Urpala
[93808, 926288, 4771052, 17975672][93808, 1626768, 2642211, 5974137, 11469744, 18265104]Uoti Urpala
[106656, 668096, 1290432, 2972112][106656, 352044, 1158399, 1677984, 1751904, 3267936]Uoti Urpala
[126720, 281760, 691680, 1199808][126720, 381780, 435456, 785455, 1932120, 5818120]Uoti Urpala
[128060, 2436940, 4355560, 10180808][128060, 668325, 1252860, 3836100, 4223100, 5021700]Uoti Urpala
[134640, 871080, 6026160, 13563144][134640, 1177335, 2744208, 4738410, 5567760, 11449058]Uoti Urpala
[148656, 1418844, 4566156, 12070320][148656, 3752880, 5268000, 8405695, 15846000, 19380000]Uoti Urpala
[151326, 195174, 447426, 706426][151326, 189630, 273870, 299670, 474453, 817530]Uoti Urpala
[152768, 2974853, 9777152, 31382912][152768, 1947792, 4102168, 7867056, 11199804, 20190016]Uoti Urpala
[159180, 612045, 1510068, 2327220][159180, 408660, 678360, 1055040, 1882776, 2205560]Uoti Urpala
[215880, 1333920, 9515940, 25499040][215880, 1450680, 2438205, 4266680, 4996761, 18729480]Uoti Urpala
[229383, 595287, 1161468, 4677948][229383, 452529, 1718073, 2387847, 2860209, 11519431]Uoti Urpala
[231840, 3004260, 4539924, 20807640][231840, 699545, 1969632, 3199185, 9472320, 66306240]Uoti Urpala
[244720, 417781, 2077712, 4724720][244720, 590140, 907200, 1217160, 3935680, 21160160]Uoti Urpala
[254100, 651420, 3672900, 5205420][254100, 381675, 881034, 4150300, 8332940, 19464060]Uoti Urpala
[323323, 13995267, 56034363, 182130333][323323, 20624681, 35913724, 47146372, 80905363, 221948804]Uoti Urpala
[399000, 536484, 4313400, 11722620][399000, 518035, 1576200, 2837688, 7266840, 14364840]Uoti Urpala
[400320, 577080, 947520, 2582720][400320, 1025952, 1293120, 1436640, 1743165, 15994080]Uoti Urpala
[400365, 1707240, 2583000, 4911144][400365, 974925, 1548365, 3717675, 4264533, 15763475]Uoti Urpala
[411895, 1010240, 3092320, 7385840][411895, 860145, 1143857, 1560945, 3115255, 8599305]Uoti Urpala
[555520, 1413104, 7747520, 17295520][555520, 1127850, 3443790, 4166400, 4761600, 23994775]Uoti Urpala
[561085, 1979480, 6968360, 34372555][561085, 2239461, 6241635, 6945435, 26359515, 46981285]Uoti Urpala
[607376, 907120, 2494580, 11298980][607376, 2092640, 3565376, 4488649, 5073376, 13845601]Uoti Urpala
[664020, 2165460, 3121965, 5733420][664020, 1643152, 2232720, 4292568, 6982920, 13623120]Uoti Urpala
[664076, 1295476, 2107924, 9966476][664076, 704060, 1290240, 5523840, 8536960, 29745765]Uoti Urpala
[742560, 4405856, 13302744, 27101256][742560, 1617408, 6211842, 9185967, 10509408, 23613408]Uoti Urpala
[919921, 15637756, 21728516, 113781884][919921, 5298447, 12436503, 46948407, 55338519, 130195401]Uoti Urpala
[969272, 5338340, 18330760, 32563160][969272, 3002472, 7267095, 14630472, 30718728, 79284600]Uoti Urpala
[1014860, 1347885, 2223540, 5252940][1014860, 1427888, 1602920, 3101560, 6195980, 12005840]Uoti Urpala
[1055700, 2416176, 6104700, 13851600][1055700, 1643220, 3548340, 9452340, 13013415, 15806260]Uoti Urpala
[1624536, 3719952, 21364872, 38753424][1624536, 4820634, 8490664, 31979619, 37993176, 237817944]Uoti Urpala
[1754808, 20436108, 39416608, 107222808][1754808, 6134535, 12319560, 15782136, 186050040, 297618915]Uoti Urpala
[1929240, 4320504, 5914680, 20237355][1929240, 2422728, 3854340, 9517860, 15478540, 50502760]Uoti Urpala
[2528310, 11504130, 12535050, 24640550][2528310, 8811810, 18636435, 24229815, 30766806, 49656690]Uoti Urpala
[2650604, 19864229, 30754796, 134295700][2650604, 9039360, 18573060, 28061440, 37485096, 652477440]Uoti Urpala
[5147520, 35284480, 61461312, 98280105][5147520, 14842800, 32866200, 69761160, 129627120, 229568640]Uoti Urpala
[6017895, 29670375, 42957369, 112966119][6017895, 9608058, 24695658, 42304208, 52369200, 70979792]Uoti Urpala
[6328080, 117702288, 284368095, 467905680][6328080, 44622620, 54067860, 177186240, 246584184, 1166476080]Uoti Urpala
[8558550, 40347450, 87297210, 162507114][8558550, 17763200, 23151975, 54774720, 156499200, 916563648]Uoti Urpala
[16869545, 40791520, 178529120, 387890272][16869545, 50939735, 86963415, 229181271, 353828055, 816442935]Uoti Urpala
[17555300, 141727040, 368704700, 1044447040][17555300, 92298780, 176746500, 273078225, 1009193220, 2015297028]Uoti Urpala
[18198675, 22792275, 59135725, 165669075][18198675, 28936050, 45841950, 51351300, 156456300, 495399996]Uoti Urpala
[33558000, 122151120, 501068880, 749266245][33558000, 466256112, 525070840, 636930840, 930563340, 1496399160]Uoti Urpala
[50250144, 116166939, 268033809, 521032224][50250144, 144323088, 191540748, 213709188, 1227407068, 1783421016]Uoti Urpala
[67041780, 118174485, 150158580, 845395980][67041780, 159942120, 258931920, 582481380, 1097199480, 1268345552]Uoti Urpala
[194285520, 411016905, 495199120, 1171600560][194285520, 234123864, 277690920, 1121557320, 1238324880, 13340292648]Uoti Urpala

Does a 5*5 solution exist?

The existence of a 5*5 solution (a solution with 5 elements both in A and B) is still open unfortunately...
As seen from the many 4*6 primitives solutions found by Uoti Urpala, a 5*5 solution would involve some really high numbers.(remember they are squared when transformed to a SAS).
Here is what Uoti Urpala said about the range he searched:

I did show that if any exist, then (barring bugs in my search) they cannot have
two elements in the same set which are less than 4 billion apart. As a
special case that means the second smallest element in a set must be at
tleast 4 billion, 3rd smallest 8 billion and so on.


Algoritm used by Uoti Urpala:

First, if you know the difference between two squares, y^2-x^2=C, then
you can find the possible values of x and y if you know the
factorization of C. y^2-x^2 = (y-x)(y+x), which means C is the product
of those two factors. So y-x and y+x are divisors of C. If y-x=d, then
y+x must be C/d (since their product is C). From this can solve
x = (C/d - d)/2. So you get at most half as many possible values for x
as there are divisors of C (for every d, C/d pair of divisors you get
one possible value of x; if C is even, both d and C/d must be even so
you get somewhat less). Denote the set of possible x (smaller squares)
for difference C with SQ(C).

The most thorough search I did was for all possible sets with a
difference between two members below 4 billion (note that this is
difference of squares or of "raw" form, not difference of the square
roots I used in writing the solutions). This was done directly by going
through all the possible differences one by one (going from 1B to 4B is
enough, since there's a multiple of anything between 0B and 1B in that
interval). Below is a description for how to handle one difference.

The smallest 4+6 solution is
A=[2988, 5052, 12108, 34812] B=[2988, 4356, 5787, 11164, 17046, 23948]
in the notation that the smallest member of this A, A0, is
sqrt(smallest in original "raw" A + smallest in original B), and so on
with other members of original A for A1, A2, A3. A0 obviously always
equals B0. Instead of "a+b is square" we have "a^2+b^2-A0^2 is square".

The smallest difference between squares is 4356^2-2988^2=10046592.
So when going through all possible differences, how do we find this
solution when calculation solutions for 10046592? First, SQ(10046592) =
{93, 447, 468, 642, 652, 828, 1422, 1612, 1623, 1818, 1842, 2043, 2262,
2988, 3228, 3242, 3492, 3523, 4073, 4383, 4682, 5013, 5052, 5382, 5748,
7002, 7428, 7453, 7902, 7958, 8433, 8962, 10093, 10788, 11412, 12108,
14517, 15342, 16263, 16372, 17298, 18332, 21918, 23148, 24522, 26067,
30927, 32972, 34812, 36868, 44007, 46458, 49197, 52278, 66058, 69732,
73838, 78457, 92997, 104628, 132173, 139518, 147727, 156962, 209292,
279063, 313948, 418602, 627908, 837213, 1255822, 2511647}. Since we
assume there are two squares with this difference, the smaller square
must be one of these. We can try each (and 2988 is there).

So now we're assuming that there's a difference between squares of
10046592, and the smaller square is 2988. We can assume this is in set
B, or in other words Bj^2 - Bi^2 = 10046592, Bi=2988 (and Bj must then
be sqrt(2988^2 + 10046592) = 4356, but we don't need to calculate
that). Now consider any of A1, A2, A3 and then the general "a^2+b^2-
A0^2 is square" for Bi, Bj. The difference between the value of
Ai^2+Bi^2-A0^2 and of Ai^2+Bj^2-A0^2 is 10046592, and both must be
squares for any Ai. Since these are pairs of squares with that
difference, the smaller must be in SQ(10046592). Ai^2+Bi^2-A0^2 = D^2
where D is in SQ(10046592) -> Ai^2-A0^2 = D^2-Bi^2 = D^2-2988^2.

So now we have a finite set of possible values that Ai^2-A0^2 can have,
D^2-2988 for each D in SQ(10046592). For each Bi, Bi^2 is obviously a
square, and Ai^2+Bi^2-A0^2 = Bi^2 + Ai^2-A0^2 must be a square. This
means that Ai^2-A0^2=D^2-2988^2 is the difference between two squares,
the smaller of which is Bi^2. Thus Bi must be in SQ(D^2-2988^2).
Conversely, if we select a Bi which is in SQ(Ai^2-A0^2) for all Ai,
then all the sums will be squares as required. So now if we can find 3
Di in SQ(10046592) such that there exists 6 numbers Bi which are in
SQ(Di^2-2988^2) for each of them we'll have a 4+6 solution. In this
case there are 5052, 12108, and 34812, with

SQ(5052^2 - 2988^2) = {54, 209, 692, 972, 1132, 1441, 1639, 1756, 1926,
2234, 2798, 2988, 3123, 3964, 4356, 4586, 5042, 5342, 5522, 5787, 6277,
7204, 7524, 8163, 9218, 9918, 10333, 11164, 11716, 12049, 14117, 15212,
15822, 17046, 19081, 20439, 22868, 23948, 25769, 28666, 30826, 32031,
34452, 43119, 46006, 48154, 51778, 57548, 61853, 69084, 86382, 92147,
96437, 103676, 115204, 129613, 138258, 172836, 207412, 230462, 259274,
276561, 345708, 414854, 460951, 518572, 691434, 829723, 1037156,
1382877, 2074318, 4148639}

SQ(12108^2 - 2988^2) = {106, 419, 496, 818, 887, 1132, 1492, 1808,
2134, 2259, 2988, 3312, 3942, 4356, 5004, 5346, 5787, 6138, 6277, 6644,
7006, 7281, 7426, 7799, 8188, 8282, 8668, 8933, 9071, 9428, 9844, 9934,
10256, 10736, 11164, 11612, 12167, 12816, 13284, 14211, 14832, 15822,
16353, 17046, 17604, 18418, 19007, 19458, 19697, 20966, 21124, 21776,
22462, 23074, 23792, 23948, 24508, 25348, 26102, 26896, 27089, 27886,
29052, 29898, 30547, 32724, 34551, 34893, 36828, 37872, 39401, 41364,
44227, 44528, 45772, 47084, 48257, 49636, 49936, 51014, 52634, 54091,
55628, 56002, 57548, 59179, 59814, 61461, 62726, 66978, 71226, 75024,
77076, 83952, 90196, 92654, 95248, 100298, 100892, 103027, 106237,
107239, 112174, 112916, 115984, 119222, 120483, 126268, 134721, 143172,
150732, 154818, 168516, 179073, 180962, 185863, 191036, 201109, 202294,
214958, 224807, 226288, 232412, 238876, 252944, 286704, 301806, 309969,
337338, 358434, 362209, 382342, 404843, 430156, 452804, 465046, 477968,
506092, 537731, 573588, 603783, 674829, 717012, 764819, 860432, 905722,
930203, 956044, 1012286, 1075558, 1147266, 1434096, 1720924, 1811501,
1912142, 2024623, 2151164, 2294577, 2868228, 3441878, 3824311, 4302352,
5736474, 6883771, 8604716, 11472957, 17209438, 34418879}

SQ(34812^2-2988^2) = {414, 670, 1002, 1101, 1569, 1676, 1980, 2364,
2655, 2988, 3245, 3678, 3970, 4356, 4770, 5658, 5787, 6095, 6780, 7041,
7380, 7677, 8070, 8382, 8492, 8513, 9420, 9846, 10245, 10548, 11164,
11268, 11924, 12195, 12330, 12602, 13266, 13372, 14004, 14733, 14901,
15180, 15543, 16166, 16284, 16620, 17046, 17370, 17742, 18030, 18517,
19284, 19755, 20295, 20772, 21220, 21561, 22070, 22374, 22770, 23118,
23580, 23948, 24078, 24771, 25180, 25497, 25689, 26532, 26855, 27276,
27402, 28138, 28530, 28695, 29028, 29844, 30756, 30899, 31145, 31662,
32220, 33429, 33606, 34030, 34569, 34980, 35453, 35820, 36795, 37239,
37396, 37426, 38730, 39348, 39930, 40374, 41282, 41436, 41955, 42412,
43020, 43429, 43677, 44433, 44594, 45558, 46938, 47370, 47934, 48103,
48907, 49092, 49620, 50292, 50805, 51396, 51855, 52634, 53868, 54630,
56286, 56529, 57020, 58420, 58923, 59580, 60159, 60930, 61546, 61764,
63620, 64482, 65295, 65916, 67188, 67404, 68669, 69345, 69630, 70206,
71622, 73212, 73462, 74799, 75167, 75780, 76581, 78228, 78980, 79938,
80670, 81514, 82170, 84998, 85052, 86145, 87405, 88524, 89580, 90387,
92041, 92322, 93270, 94106, 95220, 96426, 98113, 99891, 100363, 102444,
103245, 104292, 104606, 106446, 107430, 107845, 108684, 110748, 113068,
113433, 115386, 116820, 119943, 120402, 121330, 122907, 123980, 126180,
128745, 129917, 130332, 133870, 135516, 137070, 138258, 140694, 141108,
142505, 145380, 146487, 147159, 149211, 152274, 152756, 156046, 157230,
158778, 161964, 163420, 165276, 166695, 168332, 169605, 175099, 175204,
177330, 181962, 182643, 184020, 189369, 191220, 192853, 195030, 197388,
205094, 207405, 209172, 212796, 213412, 217023, 218955, 219770, 221418,
225474, 230036, 230754, 234597, 237420, 239727, 244476, 246305, 249414,
251530, 255870, 264066, 267395, 271055, 274308, 277380, 279729, 284547,
285366, 288130, 293820, 297342, 307473, 308428, 314948, 317295, 320364,
326682, 329570, 333252, 339316, 347211, 352958, 357180, 366381, 367734,
370470, 375121, 384780, 392355, 397044, 412372, 416970, 420486, 427698,
428924, 441580, 444861, 446853, 452937, 462022, 463452, 476730, 481326,
490788, 500628, 504845, 513495, 529833, 536470, 550254, 552281, 556380,
572307, 577820, 589170, 596196, 618314, 626055, 631324, 642132, 654741,
660505, 667854, 679958, 695718, 707191, 715620, 722509, 736692, 742155,
751442, 770730, 795222, 825836, 835020, 842043, 856449, 858898, 884180,
894714, 925019, 927876, 954405, 963588, 982494, 1002156, 1043937,
1073780, 1101327, 1105378, 1113570, 1156420, 1179105, 1193148, 1237357,
1252830, 1263362, 1284966, 1336383, 1342351, 1360579, 1392084, 1431870,
1445642, 1473996, 1503484, 1542045, 1591011, 1652218, 1670580, 1718321,
1768870, 1789932, 1856238, 1879445, 1927644, 1965447, 2004762, 2088306,
2147980, 2211164, 2227545, 2313230, 2386674, 2506020, 2527081, 2570283,
2685038, 2784492, 2864055, 2891596, 2948298, 3007268, 3132579, 3304709,
3341430, 3537995, 3580116, 3712719, 3759130, 3855522, 4009749, 4176828,
4296170, 4422532, 4626655, 4773537, 5012220, 5370244, 5569146, 5783348,
5896749, 6014686, 6265302, 6682995, 7160358, 7518380, 7711161, 8353764,
8592445, 8845166, 9397993, 10024530, 10740572, 11138373, 11566774,
12029447, 12530676, 14320779, 15036820, 16707582, 17690383, 18796034,
20049105, 21481186, 23133587, 25061388, 30073670, 33415191, 37592092,
42962393, 50122794, 60147355, 75184196, 100245597, 150368398,
300736799}
Each of those contains 2988, 4356, 5787, 11164, 17046 and 23948. This
gives the solution A=[2988, 5052, 12108, 34812], B=[2988, 4356, 5787,
11164, 17046, 23948]. I wrote an optimized C implementation to
calculate SQ(x) for each of the values (SQ(D-2988) for each D here) and
find nontrivial intersections of multiple sets. It's fast enough to
scan all differences up to 10M and find the first 4+6 solution within a
couple of minutes, but the next solution is already at difference
15855^2-6720^2 which is over 200M, over 20 times as far (and scanning
larger numbers gets somewhat slower). The per-difference work is
somewhat less than what the above example might seem to imply - that
difference is one with lots of divisors and large sets (making it more
likely that a solution is found there); there's less work per
difference on average. Scanning absolutely every difference fully isn't
optimal for finding maximum number of solutions quickly either, but I
did that for the 1B-4B interval to make sure I wasn't missing classes
of solutions I hadn't though about.

I think I found something like 16 4+6 solutions with the above method
(though I could have left it scanning for a longer time to find some
more). The rest of the 71 solutions I listed were generated by
"enlarging" 4+5 solutions found with the above method. For example,
consider the largest primitive solution I've found:

A = [194285520, 411016905, 495199120, 1171600560]
B = [194285520, 234123864, 277690920, 1121557320, 1238324880, 13340292648]

This was generated starting from
A = [23760, 50265, 60560, 143280]
B = [23760, 28632, 33960, 137160, 151440]

It's impossible to add any numbers to either set A or set B without
breaking the square-sum property. If you calculate SQ(Ai^2-A0^2) for
the Ai, the sets do not have more than 5 members in common, which means
there do not exist numbers which could be added to B. Similarly for
adding to A. However, multiples of a solution are always (non-
primitive) solutions. And multiplying the numbers introduces new
divisors, which means that the SQ sets get more members, and in a lucky
case all the sets get a common new member.
Here SQ(50265^2-23760^2), SQ(60560^2-23760^2), SQ(143280^2-23760^2)
have the 5 members of B in common. But if you multiply them all by
8177, they'll have the old common members times 8177, AND in this case
there's the new common member 13340292648 (which has no factors in
common with the others, so the solution is primitive).

Example implementation:

Jess Thrysøe kindly shared his C++ program with me. It simpler than mine and is faster at finding the first 4*6 solution: C++

Read about my next adventure, computer generated art

Contact information:

If you have any questions or contributions to the problem you can contact me at thomas.egense@gmail.com