Talk:Pythagorean triples: Difference between revisions
Content added Content deleted
(→For reference: I got 325 for 1000) |
|||
Line 20: | Line 20: | ||
Hmmm... I get 324 and 4857 for perimeters of 1000 and 10000 respectively. I see that the Python solution also gets 324 for a perimeter of 1000. Am I missing something?--[[User:Tikkanz|Tikkanz]] 23:59, 28 June 2011 (UTC) |
Hmmm... I get 324 and 4857 for perimeters of 1000 and 10000 respectively. I see that the Python solution also gets 324 for a perimeter of 1000. Am I missing something?--[[User:Tikkanz|Tikkanz]] 23:59, 28 June 2011 (UTC) |
||
:I got 325 for 1000 using Java. Here's the full list: http://pastebin.com/HK74uBCz --[[User:Mwn3d|Mwn3d]] 00:49, 29 June 2011 (UTC) |
:I got 325 for 1000 using Java. Here's the full list: http://pastebin.com/HK74uBCz --[[User:Mwn3d|Mwn3d]] 00:49, 29 June 2011 (UTC) |
||
::Good, beat me to it. I was wondering if I should post the list here, guess not :) --[[User:Ledrug|Ledrug]] 00:52, 29 June 2011 (UTC) |
Revision as of 00:52, 29 June 2011
Confirmation of coprime
So perimeter is really easy. Coprime isn't something that people outside of math talk about much. I had to look it up on Wikipedia to figure it out, but I'm still not quite sure. It's defined nicely there for two numbers, but we are dealing with three here. Are a, b, and c coprime if gcd(a, b) = gcd(b, c) = gcd(a, c) = 1? Do I need the third gcd evaluation? --Mwn3d 15:28, 28 June 2011 (UTC)
- Since a^2 + b^2 == c^2, if any two of them are coprime, the third is also coprime to both, so there's no difference how you interpret "coprime" in this situation. --Ledrug 15:50, 28 June 2011 (UTC)
For reference
The correct results:<lang> 10 0 0
100 17 7 1,000 325 70 10,000 4858 703 100,000 64741 7026 1,000,000 808950 70229 10,000,000 9706567 702309 100,000,000 113236940 7023027
1,000,000,000 1294080089 70230484 </lang> --Ledrug 18:27, 28 June 2011 (UTC)
Hmmm... I get 324 and 4857 for perimeters of 1000 and 10000 respectively. I see that the Python solution also gets 324 for a perimeter of 1000. Am I missing something?--Tikkanz 23:59, 28 June 2011 (UTC)
- I got 325 for 1000 using Java. Here's the full list: http://pastebin.com/HK74uBCz --Mwn3d 00:49, 29 June 2011 (UTC)
- Good, beat me to it. I was wondering if I should post the list here, guess not :) --Ledrug 00:52, 29 June 2011 (UTC)