Show that there is no right triangle whose legs are rational numbers and whose hypotenuse is $\sqrt{2022}$. Show that there is no right triangle whose legs are rational numbers and whose hypotenuse is $\sqrt{2022}$.
My tries:

*

*I used Pythagoras' Theorem to get: $$\sqrt{2022}^2=a^2+b^2 \implies a^2+b^2 = 2022$$
where $a$ and $b$ are the legs of the triangle.
I don't know what to do next: Is there another formula I could use?
I know that $a+b>\sqrt{2022}$ but I don't think this is going to help us much.

hope one of you can help me! thank you!
 A: Quickly ruling out $\ a\ $ being even, we try $\ a\ $ and $\ b\ $ both being odd:
$$ (2k_1+1)^2 + (2k_2+1)^2 = 2022\quad k_1,k_2\in\mathbb{Z}$$
$$ \implies 4({k_1}^2 + {k_2}^2 + k_1 + k_2) + 2 = 2022 $$
$$  \implies {k_1}^2 + k_1 + {k_2}^2 + k_2 = 505, $$
which is impossible, since $\ {k_i}^2 + k_i\ $ is even for $\ i=1,2.$
A: Lettin $a=\frac{x}{k}$, $b=\frac{y}{k}$, where $x,y,k$ are positive integers and $\gcd(x,y,k)=1$, we get, as Henry told, $x^2+y^2=2022k^2$. From this equation, it is not difficult to see that $x$ and $y$ must be odd. See Adam's answer. If $x,y$ are odd then since square of an odd number modulo $8$ is $1$, we get the modular equation $6k^2\equiv2\pmod 8$ which has no integer solutions.
A: An alternative answer:
From the comments, I have shown that
$$x^2+y^2 = 2022k^2$$
So, it remains to show that $2022k^2$ can not be represented as the sum of squares of 2 integers. For contradiction, assume that $2022k^2$ can be represented as the sum of $2$ squares. From the Sum of two squares theorem, if $2022k^2$ can be represented as the sum of squares of $2$ integers, it will have prime factors of the form $4n+3$ raised to an even power. $3$ is of the form $4n+3$. Let $$k = 3^pq$$ where $p \ge 0$ and $q$ are integers such that $3$ does not divide $q$. Then, $k^2 = 3^{2p}q^2$. Thus, $$2022k^2 = 2\times 3 \times 337 \times 3^{2p}q^2 = 3^{2p+1} \times 2 \times 337 \times q^2$$We know that $q^2$ does not contain $3$ in its prime factorisation, since $q$ does not contain $3$ in its prime factorisation. So, $2022k^2$ has $3^{2p+1}$ in its prime factorisation and no other $3$.  But, $2p+1$ is an odd number. Thus, we get a contradiction, $2022k^2$ cannot be represented as the sum of squares of $2$ integers, meaning $2022$ cannot be represented as the sum of squares of $2$ rational numbers.
A: I think this answer is better than my previous one.

I was doing an unrelated question when I thought of this question and a solution struck me too (don't ask me how). So here it goes:
Write the equation as (using different variables this time):
$$\left(\frac pr\right)^2 +\left(\frac qs\right)^2 = 2022$$where these are the fractions in their lowest terms. We get:
$$\color{green}{(ps)^2+(qr)^2 = 2022(rs)^2}$$Both sides are integers, one is divisible by an even power of $3$, the other by an odd power. Hence, there is no solution. (Because in LHS, both terms can only be $0,1 \pmod 3$. Let $ps = 3^mk$ and $qr = 3^nl$ such that $k,l \neq 0 \pmod 3$. Then LHS is divisible by $3^{2m}$ or $3^{2n}$, whichever is lesser. So, LHS is divisible by an even power of $3$. On the other hand, RHS is divisible by an odd power of $3$ since $2022 = 3 \cdot 2 \cdot 337$. )
