22

I. This post asks to find $4$ integers $a,b,c,d$ such that the difference between any two is a square. As mentioned by my answer, it is equivalent to finding $3$ squares such that the difference of any two is also a square.

With the positive answer to that question, the OP of that post muses if we can also find $FIVE$ integers $a,b,c,d,e$ such that the difference of any two is a square. Equivalently, we are to solve System 1,

$$p^2+w^2 = x^2\\ q^2+w^2 = y^2\\ r^2+w^2 = z^2\\ s^2+x^2 = y^2\\ t^2+x^2 = z^2\\ u^2+y^2 = z^2$$

If this has a positive solution, then it involves three special hypotenuse $\color{blue}{x,y,z}$ expressible as Pythagorean triples in $1$, $2$, and $3$ ways,

$$p^2+w^2 = \color{blue}{x^2}$$ $$q^2+w^2 = s^2+x^2 = \color{blue}{y^2}$$ $$r^2+w^2 = t^2+x^2 = u^2+y^2 = \color{blue}{z^2}$$

which seems doable.


II. Alternatively, by solving the system for $p,q,r,s,t,u$, then we can reduce the number of variables to finding just four squares $w^2< x^2<y^2<z^2$ such that the difference between any two is a square, or System 2,

$$-w^2+x^2 =\square_1\\-w^2+y^2=\square_2\\-w^2+z^2=\square_3\\-x^2+y^2=\square_4\\-x^2+z^2=\square_5\\-y^2+z^2=\square_6$$

For the special case $w = 0$, the smallest of infinitely many solutions is,

$$w,x,y,z = 0, 153, 185, 697$$

Q: More generally, can we find four squares $w^2,x^2,y^2,z^2$ of System 2 such that $w\neq0$?

Update: Using zwim's data here, we find that for $w,x,y,z = 448, 952, 1073, 1105$, then,

$$-w^2+x^2 =840^2\\-w^2+y^2=975^2\\-w^2+z^2\neq\square_3\,\,\\-x^2+y^2=495^2\\-x^2+z^2=561^2\\-y^2+z^2=264^2$$

Almost, but not quite. But I believe a higher search range will yield something.

  • 1
    My calculations made so far suggest that $z$ is well over 500,000. – Saša Jul 08 '19 at 15:44
  • 1
    @Oldboy: Thanks. But that is strange. The smallest solution such that the relations yield at least 5 squares only has $z=1105$ in the update. – Tito Piezas III Jul 08 '19 at 15:59
  • True, but with my code I have been able to reproduce all those results but still could not find the solution with 6 squares. – Saša Jul 08 '19 at 16:20
  • @Oldboy: Ok. I have an idea. Rathbun's results have the 3-square case with the $z$ up to the millions. I'll check those. – Tito Piezas III Jul 08 '19 at 16:24
  • @Oldboy: A favor. Can you modify your code to search such that 5 out of the 6 are squares? And post some of the results as a partial answer? The results might give a trend or pattern. – Tito Piezas III Jul 08 '19 at 16:37
  • Let me run the current program (searching for 6 out of 6) overnight. If that fails I'll modify the program to search for 5 out of 6. – Saša Jul 08 '19 at 16:43
  • @Oldboy: Oops, never mind about the 5 out of 6. I just found a parameterization for it. It's the 6 out of 6 that is a challenge. – Tito Piezas III Jul 08 '19 at 17:30
  • I have left my code running, stay tuned. :) – Saša Jul 08 '19 at 20:06
  • Still no luck :( If the solution exists, $z$ must be greater than $1.6\times10^6$. But I'm a stubborn guy, still running the code. – Saša Jul 09 '19 at 08:21
  • @Oldboy: Thanks for the persistence! The fact that the smallest for the 5 out of 6 case has $z\approx 10^3$, while the 6 out of 6 case still has none for $z\approx 10^6$ does not seem to bode well. But thanks again. :) – Tito Piezas III Jul 09 '19 at 08:44
  • This seems related to Euler bricks and perfect cuboids in particular, but I'm not sure whether it is the same problem in disguise... – Servaes Jul 09 '19 at 13:06
  • @Servaes: Very good intuition! The 5 out of 6 parameterization I found uses Euler bricks. However, I haven't been able to reduce this problem to perfect cuboids, though I also have a feeling they may be related. – Tito Piezas III Jul 09 '19 at 14:02
  • @Oldboy I have limited time for programming but, if you do not, perhaps you can shorten your search using formulas that I developed after I had spent too much time in $FOR$ loops from $1$ to some limit. These show how to match sides of Pythagorean triples in a defined finite search. Caveat: they will $only$ find primitives, doubles, and square multiple of primitives, i.e. they will not find $9,12,15\quad 15,20,25$, etc. Good luck – poetasis Jul 30 '19 at 18:04
  • 1
    @Tito Piezas III: Actually $z=1105$ is the smallest $z$ possible because $5\cdot13\cdot17$ is the smallest number that has at least 3 prime factors only 1 mod 4. – emacs drives me nuts Apr 04 '20 at 07:59

1 Answers1

3

I could manage to find many almost solutions (with the aim to derive full solutions) by a systematic search:

My first trials, code and ideas are posted here, where I received very helpful input that directed me to a promising approach, proposed by Peter: Search for 6-tuples $(s,t,u,t+u,t+u−s,t−s)$ consisting of perfect squares. I implemented a Python script which systematically searched for those 6-tuples and it found a lot of instances. Unfortunatelly at a certain point it became slow and did not scale anymore.

With the help of Arty, who developed an enhaced version, I could manage to find a first allmost matches. This performance breakthrough origins from this question, I asked on SO.

On a machine with 128GB RAM, an Intel Xeon CPU E5-2630 v4, 2.20GHz processor (and two graphic cards of type Tesla V100 with 16GB RAM) I generated a large textfile of these 6-tuples $(s,t,u,t+u,t+u−s,t−s)$.

To make the final step, namely to identify these four squares, I implemented the Mathematica Script pythagorean.nb, which outputs an "almost solution": [w=40579, x=-58565, y=-65221].

From the data set I selected the corresponding row:

42228, 51060, 185472, 1783203984, 2607123600, 34399862784, 37006986384, 35223782400, 823919616

Hence $s=42228^2,t=51060^2,u=185472^2$. To calculate the last variable $z$, I need to use the equation $u+y^2=z^2$ leading to $z=196605,294$.

Now my idea is to multiply all integers $w,x,y,z$ with a suitable integer, for example with $10^{10}$ to bring us closer towards a solution:

  • $z^2-y^2=1854720000103154^2$
  • $z^2-x^2=1876800000101940.2^2$
  • $z^2-w^2=1923720000099454^2$
  • $y^2-x^2=287040000000000^2$
  • $y^2-w^2=510600000000000^2$
  • $x^2-w^2=422280000000000^2$

An excerpt of the list containing such "almost" solutions, I could generate so far is (raw output of Mathematica):

  • $w=40579,x=-58565,y=-65221,z=196605.2940$
  • $w=53900,x=-71540,y=-91756,z=157415.4376$
  • $w=534240,y=-540600,z=-554115,x=537302.7941$
  • $w=67375,x=-89425,y=-114695,z=196769.2970$
  • $w=81158,x=-117130,y=-130442,z=393210.5880$

The Mathematica Code is shown below:

arr = Import[
   "C:/Users/esultano/git/pythagorean/pythagorean_stu_Arty_.txt", 
   "CSV", "HeaderLines" -> 0];
f[i_] := Part[arr[[i]], 1 ;; 3];
len = Length[arr];
For[i = 1, i < len, i++, {
  triplet = f[i];
  s = triplet[[1]];
  t = triplet[[2]];
  u = triplet[[3]];
  ins = FindInstance[
    x*x - w*w == s*s && y*y - w*w == t*t && w != 0, {w, x, y}, 
    Integers];
  If[Length[ins] > 0, 
   Print[Append[First[ins], 
     z -> N[Sqrt[u^2 + First[ins][[3, 2]]^2], 10]]], Continue];
  ins = FindInstance[
    y*y - w*w == t*t && z*z - y*y == u*u && w != 0, {w, y, z}, 
    Integers];
  If[Length[ins] > 0, 
   Print[Append[First[ins], 
     x -> N[Sqrt[s^2 + First[ins][[1, 2]]^2], 10]]], Continue];
  }
 ]
  • 1
    Great that you finally found solutions! If for some reason we need many more solutions, or to scan larger space, I still have ideas of improvements to code speed. Latest enhanced version should be much faster than previous. And still there is a lot of space to improve speed further. Also such solution is extendable from 4-tuple squares to 5 and 6 tuple if needed. – Arty Jan 24 '22 at 03:51
  • Yes we will search and find more. I am on it and will try your new enhanced version today. – Eldar Sultanow Jan 24 '22 at 05:33
  • I double checked them. These are (due to loss of precision) still almost solutions. Need to search further. – Eldar Sultanow Jan 24 '22 at 08:02