3

The sum of two integers is a square. The sum of their squares is also a square. E.g. $$ -3 + 4 = 1^2, \ (-3)^2 + 4^2 = 5^2 $$

$$ 9 + 40 = 7^2, \ 9^2 + 40^2 = 41^2 $$

Question: General solution/form of all such pairs.

Clarification: By general form we mean a parametric form like Euclid's solution for Pythagorean triplets $a = r^2 - s^2, \ b = 2rs$ and $c = r^2 + s^2$ which covers all Pythagorean triplets.

2 Answers2

2

WLOG for $d^2=a^2+b^2, a=2mn, b=m^2-n^2$

$a+b=m^2-n^2+2mn$

Let $m^2-n^2+2mn=(m+pn)^2\iff n(p^2+1)=2m(1-p)$

$\dfrac n{2(1-p)}=\dfrac m{1+p^2}=r$(say)

Now $(1+p^2,1-p)|(1+p^2,1-p^2)$ which must divide $1+p^2+1-p^2=2$

Case $\#1:$ $(1+p^2,2(1-p))=1$ if $p$ is even

$n=2r(1-p^2),m=r(1+p^2)$

Case $\#2:$ For odd $p, p^2\equiv1\pmod8, 1+p^2\equiv2$

In that case, $(1+p^2,2(1-p))=2$

$n=r(1-p)$ and $m=\dfrac{r(1+p^2)}2$

1

An old question, but with a distinguished pedigree. Fermat and Mersenne also considered this back in 1643 but in the context of positive Pythagorean triples $(a,b,c)$ and made things harder by requiring fourth powers,

$$a+b = n^2\\a^2+b^2 = m^4$$


I. Second powers

For the OP's question,

$$a+b = t^2\\a^2+b^2 = c^2$$

The second equation is routine and we use $(a,b)=(p^2-q^2,\,2pq)$. Substitute into the first,

$$p^2+2pq-q^2=t^2$$

Do the substitution $(p,q) = (r-s,\,s)$ to get the conditional equation,

$$r^2-2s^2=t^2$$ $$r^2+ns^2=t^2$$

For general $n$ and primitive $(r,s)$, this has the complete solution,

$$(x^2-ny^2)^2+n(2xy)^2 = (x^2+ny^2)^2$$

with Pythagorean triples just the case $n=1$. Undoing all the transformations, then the general solution to your question is,

\begin{align} a &= (x^2 + 2 y^2) (x^2 - 4 x y + 2 y^2)\quad\\[4pt] b &=\, 4 x y (x^2 - 2 x y + 2 y^2) \end{align}

For example, let,

\begin{align} (x,y) &= (1,1),\quad\text{yields}\; (a,b)= (\color{blue}{-3,\,4})\\ (x,y) &= (1,2),\quad\text{yields}\; (a,b)=\, (\color{blue}{\,9,\,40}) \end{align}

which are the two values you found.


II. Fourth Powers

For the special case when the Pythagorean triple has a square hypotenuse $(a,b,c^2)$, understandably this would need larger numbers. The smallest Fermat found was,

$$4565486027761+ 1061652293520 = \color{blue}{2372159}^2\\ \;\;4565486027761^2+ 1061652293520^2 = \color{blue}{2165017}^4$$

To find infinitely many, let $(a,b)=\left(\dfrac{p^2+r}2,\;\dfrac{p^2-r}2\right)$, then,

$$a+b = p^2\\ a^2+b^2 = q^4$$

where $(p,q,r)$ must satisfy,

$$p^4-2q^4=-r^2$$

Compare the similarity to the conditional equation for second powers. There are also infinitely many solutions,

$p = 1, 1343, \color{blue}{2372159}, 9788425919, 5705771236038721, \dots$ (A167437)

$q = 13, 1525, \color{blue}{2165017}, 42422452969, 7658246457672229, \dots$ (A166929)

though if we require positive $(a,b)$, then a subsequence of $q$ is (A166930) and the blue numbers are the smallest.

P.S. The equation $p^4-2q^4=\pm r^2$ appears in a special case of $a^4+b^4+c^4=2d^2$ in this MSE post and which led me to this topic.