# Find all right-angled triangles whose hypotenuse is $2^{2015.5}$

Find all right-angled triangles whose hypotenuse has length $2^{2015.5}$ and whose other two sides have integral lengths.

My attempt: As $2^{2015.5}=2^{2015} \sqrt2$, the other lengths of the triangle can be $(2^{2015},2^{2015})$. Are there any other possible cases?

• Hint: You want to solve $x^2+y^2=2^{4031}$ for $x,y \in \mathbb N$. Look at the Gaussian integers. – lhf Sep 20 '16 at 15:33
• Please tell me how to solve that equation sir because I don't know how to solve it – sai saandeep Sep 20 '16 at 15:41

A natural attempt is to work in the ring $\mathbf Z[i]$ in order to exploit its factoriality. $2$ factors as $(1+i)(1-i)$ in this ring, and our equality becomes

$$(x + yi)(x - yi) = (1 + i)^n (1 - i)^n = i^n (1 - i)^{2n}$$

where $n = 4031$. The right hand side is a prime factorization in the factorial ring $\mathbf Z[i]$, and the quantities on the left hand side are conjugates. This tells us that the solutions are of the form

$$x + yi = \varepsilon (1 - i)^{n}$$

where $\varepsilon = \pm 1, \pm i$. Accounting for the signs, there is only one solution such that both $x$ and $y$ are positive. Since $x = y = 2^{2015}$ is clearly a solution, we are done.

An alternative approach: We proceed by induction.

Claim: Let $n = 2k + 1$ be odd. Then, the equation $x^2 + y^2 = 2^n$ has a unique solution in the positive integers, given by $x = y = 2^k$.

Proof. The claim is certainly true for $k = 0$. Assume that it is true for $k$, and let $m = k+1$. We want to show that the equation $x^2 + y^2 = 2^{2m+1}$ has a unique solution in the positive integers. Since $m > 0$, the right hand side is divisible by $4$, therefore so is the left hand side. Looking at the congruence $x^2 + y^2 \equiv 0 \pmod{4}$, we deduce that both $x$ and $y$ must be even. But then,

$$\left(\frac{x}{2}\right)^2 + \left(\frac{y}{2}\right)^2 = 2^{2k+1}$$

and by the inductive hypothesis we know that the positive integer solutions to this equation are unique, given by $x/2 = y/2 = 2^k$. Multiplying through by $2$ then gives the desired result.

Now, apply this claim to your specific problem, with $k = 2015$.

• I don't know that concept so please tell me in an alternate method. – sai saandeep Sep 20 '16 at 16:02
• I added another approach. – Starfall Sep 20 '16 at 16:22
• There might not be a better method. However maybe we can work this into a more introductory approach. I'll try and see what I can do. – fleablood Sep 20 '16 at 16:23
• That second method is very good! " x^2+y^2≡0(mod4), we deduce that both x and y must be even" This might not be universally known $(2k)^2 \equiv 0 \mod 4$ and $(2k + 1)^2 \equiv 1 \mod 4$. $x^2 \not \equiv 3 \mod 4$ so $x^2 + y^2 = 0,1,2 \mod 4$ if i)both are even ii) one odd and one even iii) both odd respectively. – fleablood Sep 20 '16 at 16:31
• In the final step of the second method, you multiply through by $2$. This clearly gives a solution, but how does it prove uniqueness? – Théophile Sep 20 '16 at 19:55