# Primitive solutions to $a^2 + 4b^2 = c^2$

I am trying to generate primitive solutions (GCD is 1 for $a, b, c$) to the equation $a^2+4b^2=c^2$. I attempted to do this by modifying the usual Pythagorean triplet $(m^2-n^2)^2 + (2mn)^2 = (m^2+n^2)^2$ but was unable to get anywhere with that approach.

-

$$a^2+4b^2=z^2\iff a^2+(2b)^2=z^2\iff \\ a=m^2-n^2, \ b=mn , \ z=m^2+n^2 , \ \ (m,n)=1 , m-n>0.$$

-
This was actually the approach I tried – WhatsInAName Jan 13 '13 at 17:38
What about that approach do you think fails, @WhatsInAName? – Thomas Andrews Jan 13 '13 at 17:41
I think maybe I went in the wrong direction with what I was trying to compensate for with the multiplication (for some reason I had 4mn... feeling a little silly right about now) – WhatsInAName Jan 13 '13 at 17:42
Oh, I remember what I was trying to do now: I was getting negative values when I tried this hours back. I am trying to generate solutions for which a,b,c are positive. Sorry if that changes anything – WhatsInAName Jan 13 '13 at 17:45
@WhatsInAName: To generate positive values $m$ must be larger than $n$. – P.. Jan 13 '13 at 17:47