Can 2021 be hypotenuse of a pythagorean triangle? I'm looking for Pythagorean triangles with a hypotenuse of length 2021. In other words, let $z=2021$ then, $z^2=x^2+y^2$ for some integers $x$, $y$. Now, when I put a hypotenuse value of 2021 to generate Pythagorean triples using an online calculator, it shows that there are no solutions i.e. no such pythagorean triangle exists.
However, $z^2=2021^2=43^2 \cdot 47^2$ and $43, 47$ are both of the form $4k+3$, so by sum of two squares theorem, since the two exponents are even, $z^2=x^2+y^2$ should be solvable...
I think there might be a flaw in my logic somewhere. Could someone clarify on this and also provide a proof in case such a triangle cannot exist?
 A: Consider the following two articles:
Generating a Triple and
Sum of Two Squares.
Since $~43 \equiv 3 \pmod{4},~$ and $~43 ~| ~2021$, the two articles collectively imply that $2021$ can not be the hypotenuse of a primitive pythagorean triple.
That is, if it is a primitive, then you would have to have
$$m^2 + n^2 = 2021$$
which is impossible.
This leaves the issue of whether it can be a non-primitive hypotenuse of a pythagorean triple.
However, since $~43 \times 47 = 2021,~$ this possibility can be manually eliminated by examining the elements in $\{1,4,9,16,25,36\}$.
That is, it is impossible to take any two of those elements and have them sum to either $43$ or $47$.
Therefore, it is game over.

Edit 
Upon reflection, both $43$ and $47$ are congruent to $3 \pmod{4},$ so, manual examination of $\{1,4,9,16,25,36\}$ isn't necessary.
A: In the sum of two squares theorem, one of the two squares is allowed to be zero. And indeed, $2021^2=2021^2+0^2$.

My answer was apparently too short to be clear, so let me expand. OP is confused because there appear to be contradicting facts:

*

*2021 is not the hypotenuse of a right triangle.

*The "sum of squares theorem" says that an integer can be written as the sum of two squares iff its prime decomposition does not contain primes $p \equiv 3 \pmod{4}$ with an odd exponent.

*$2021^2 = 43^2 \times 47^2$ is an integer whose prime decomposition does not contain any prime $p \equiv 3 \pmod{4}$ with odd exponent: all the exponents are even.

So, where's the contradiction? The answer is what I've written above:

In the sum of two squares theorem, one of the two squares is allowed to be zero. And indeed, $2021^2=2021^2+0^2$.

If I need to state this in an even clearer way: the "sum of two squares theorem" cannot be used to determine if an integer $a$ is part of a Pythagorean triple. The reason is simple, $a^2$ will never contain a prime $\equiv 3 \pmod{4}$ with an odd exponent! The sum of two squares theorem always applies, and says that $a^2$ can be written as a sum of two (possibly zero!) squares. But that much is obvious: $a^2 = a^2 + 0^2$.
A: It is not possible because the integer $n$ is a sum of two squares only when its prime factors which are congruent with $3$ modulo $4$ have an exponent even in the representation $n=\prod p_i^{n_i}$. If $2021^2=x^2+y^2$ then we must have $(2021,x,y)=(a^2+b^2,2ab,a^2-b^2)$ as it is well known.
Then, because $2021=43\cdot47$ we cannot have $2021$ as hypotenuse of a right triangle.
A: To form a pythagorean triangle they must be natural numbers, so you can't use the sum of two squares theorem to find them. Instead you can use Euclid's formula to find:
a=2021,b=180,c=2029
Of course, a is not the hypotenuse in this case
