Number Theory: Problems with Integer Squares I have these problems assigned for homework, I was able to get through the rest of the homework fine but I'm stuck on these two. Prove that


*

*If $n\equiv 6\pmod9$, then $n$ cannot be a sum of two integer squares.

*If $n\in\mathbb{N}$ is not the sum of two integer squares, then it is not the sum of two rational squares.


I've been trying to use these theorems from class but I haven't gotten far:
Theorem 8.2: For $p$ an odd prime, there exists $a\in\mathbb{N}$ so $a^2\equiv -1\pmod{p}$.
Theorem 8.3: For $p$ an odd prime, there exist $a,b\in\mathbb{N}$ so $p=a^2+b^2\iff p\equiv 1\pmod4$.
Theorem 8.4: $n\in\mathbb{N}$ is a sum of two squares in $\mathbb{Z}\iff$ every prime divisor $p$ of $n$ with $p\equiv 3\pmod4$ occurs an even number of times in the prime factorization of $n$.
 A: For the first problem we know that $(\forall (a,b) \in \mathbb{N}^2)\ a + b = c$ where $c \in \mathbb{N}$. 
So $(a + b)^2 = c^2$.
Then take $n$ and $m$ which are natural numbers, so is $n \equiv m \pmod 9$ so $ m \in \{0;1;2;3;4;5;6;7;8\}$ and because $n^2 \equiv m^2 \pmod 9$ we get that $m^2 \in \{0;1;4;7\}$.
So we remark that $n^2 \not\equiv 6 \pmod 9$ and if we change n to c we get that
$c^2 \not\equiv 6 \pmod 9 \iff (a+b)^2 \not\equiv 6 \pmod 9$. $\square$
And we're done ! 
PS: We can said that if $n \equiv 6 \pmod 9$ so, $n$ cannot be the sum of integers squares.
A: A well-known theorem states a positive integer sums to two squares iff, including multiplicity, it has an even number of prime factors $\in4\mathbb{N}-1$. We solve the second problem by showing that, if $n$ is a sum of rational squares, an integer $k>0$ exists for which $k^2n$ is the sum of two squares. The aforementioned theorem then implies, by considering the parity of prime factors $\in4\mathbb{N}-1$, $n$ will also be a sum of integer squares.
Write $n=\left(\frac{a}{b}\right)^2+\left(\frac{c}{d}\right)^2$ for integers $a,\,b,\,c,\,d$ where without loss of generality $a,\,c\ge 0,\,b,\,d>0,\,\left( a,\,b\right)=\left( c,\,d\right)=1$. In the result $\left( bd\right)^2n=\left( ad\right)^2+\left( bc\right)^2$, any prime dividing $b$ or $d$ divides each side at least twice. A prime factor of $b$ (and hence not of $a$) must divide $\left( ad\right)^2=\left( bd\right)^2n-\left( bc\right)^2$ so divides $d$, and vice versa. Write $b=kb',\,d=kd',\,\left( b,\,d\right)=1$ so $k^2n=\left(\frac{a}{b'}\right)^2+\left(\frac{c}{d'}\right)^2$. Repeating the above logic implies $b',\,d'$ have the same prime factors, so they have none i.e. $b'=d'=1,\,b=d=k$. Hence $k^2n=a^2+c^2$.
A: Theorem 8.2
Among primitive Pythagorean triples, for $X=\pm (B-A),\qquad X\equiv X^2\equiv \pm1 \mod 8.\qquad $ under 100,  $X\in \{1,7, 17, 23, 31, 41, 47, 49, 71, 73, 79, 89, 97\}$.
Theorem 8.3
$\qquad 17=4^2+1^2\qquad 73=8^2+3^2\qquad 97=9^2+4^2$
