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?
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 $.