How can I find the number of integral Pythagorean triples with a given hypotenuse?
Find the cardinality of the following set $S_n=\{(x,y)|x^2+y^2=n, \text{where }x,y,n \in \mathbb Z\text{ and }n\geq0 \}$