pythagorean triples exercise
Jeffrey Gaynor
jgaynor at ncsa.uiuc.edu
Fri Oct 22 15:40:08 EDT 2010
As I indicated, generating such triples is easy. What you found is the edge case that
2*i*j = 200 => 100 = i*j
so (i,j) = (100,1) or (50,2) (25,4), (20,5) or (10,10). The maximal value are i = 100, j = 1. The other sides are
i^2 - j^2 = 10,000 - 1 = 9999
i^2 + j^2 = 10,000 + 1 = 10,001
...and there you have your figures. A real proof consists of a bit more, but nobody wants to read it and there is no easy way to notate it in plain text.
----- Original Message -----
From: "Mel" <mwilson at the-wire.com>
To: python-list at python.org
Sent: Friday, October 22, 2010 2:20:47 PM
Subject: Re: pythagorean triples exercise
MRAB wrote:
> On 22/10/2010 13:33, Baba wrote:
>> only a has an upper limit of 200
>>
> Really? The quote you gave included "whose small sides are no larger
> than n". Note: "sides", plural.
Strangely, there does seem to be a limit. Fixing one side at 200, the
largest pythagorean triple I have found is (200, 9999, 10001.0). So far my
math has not been up to explaining why.
Mel
--
http://mail.python.org/mailman/listinfo/python-list
More information about the Python-list
mailing list