![]() |
|
Come for the quick hacks, stay for the epiphanies. | |
PerlMonks |
Re^3: pythagorean triplesby chas (Priest) |
on Apr 24, 2006 at 04:36 UTC ( [id://545204]=note: print w/replies, xml ) | Need Help?? |
Well, it's true that the primitive triples are of that form,
but not conversely; 6,8,10 occurs for n=3,m=1 (which are coprime), and that triple isn't primitive. So the code generates primitive (i.e. having no common factor) triples, but some others as well. The real point is that it isn't so easy to print a list of all Pythagorean triples without duplication, and I guess that thought was what motivated my reply.
In Section
Code Catacombs
|
|