# 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.

-

## 1 Answer

$$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 at 17:38
What about that approach do you think fails, @WhatsInAName? – Thomas Andrews Jan 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 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 at 17:45
@WhatsInAName: To generate positive values $m$ must be larger than $n$. – P.. Jan 13 at 17:47
{"extraction_info": {"found_math": true, "script_math_tex": 0, "script_math_asciimath": 0, "math_annotations": 0, "math_alttext": 0, "mathml": 0, "mathjax_tag": 0, "mathjax_inline_tex": 6, "mathjax_display_tex": 1, "mathjax_asciimath": 0, "img_math": 0, "codecogs_latex": 0, "wp_latex": 0, "mimetex.cgi": 0, "/images/math/codecogs": 0, "mathtex.cgi": 0}, "config": {"markdown_headings": true, "markdown_code": true, "boilerplate_config": {"ratio_threshold": 0.18, "absolute_threshold": 10, "end_threshold": 15, "enable": true}, "remove_buttons": true, "remove_image_figures": true, "remove_link_clusters": true, "table_config": {"min_rows": 2, "min_cols": 3, "format": "github"}, "remove_chinese": true, "remove_edit_buttons": true, "extract_latex": true}, "english_confidence": 0.9565314054489136, "perplexity_flag": "middle"}