TITLE: Integer Solutions to $x^2+y^2=5z^2$
QUESTION [11 upvotes]: I'm looking for a formula to generate all solutions $x$, $y$, $z$ for $x^2 + y^2 = 5z^2$.
Any advice?

REPLY [3 votes]: I couldn't but notice the pattern $x^2 + y^2 = 5 z^2 = z^2 + (2z)^2 $; owing to 
$(am+bn)^2 + (an-bm)^2 = (an+bm)^2 + (am-bn)^2 $, and so if we let $x=am+bn , y=an-bm , z=am-bn$ , we need $an + bm = 2(am-bn)$ , i.e. $ a(n - 2m) + b(m+2n) =0$   which is possible by 
$a = (m+2n) k , b=(2m-n)k $ , where $a,b,m,n,k$ $∈$ $\Bbb Z$
So, the solutions are :- $x = k( m^2 + 4mn - n^2 )$ ; $y = 2k(mn + n^2 - m^2 )$ ; $z = k( m^2 + n^2 )$ these are same as what "dinoboy" seems to have obtained by comparatively more effort.