# two questions about Diophantine Equation

I am reading an article Modular Arithmetic by Richard Taylor. I have 2 questions:

1. For which $n$, $x^2+y^2=nz^2$ has nontravial solutions? What are the solutions?

2. A beautiful theorem of Hermann Minkowski and Helmut Hasse says that if $Q (X_1 , ..., X_d )$ is any homogeneous quadratic polynomial in any number of variables with whole number coefficients, then

$$Q (X_1 , ..., X_d )$$

has a non-zero solution in whole numbers if and only if it has a non-zero solution in all (real) numbers and a primitive solution modulo $m$ for all positive whole numbers $m$

How to prove the beautiful theorem? Could you recommend some books?

1.) We have $$\left(\frac{x}{z}\right)^2+\left(\frac{y}{z}\right)^2=n,$$ so the answer is given by Fermat’s two square theorem for rationals:
Theorem (Fermat): A positive rational number is a sum of two rational squares if and only if in its prime factorization every prime of the form $4k + 3$ appears with an even exponent.