PyPE solution to PE problem 9

Registered by Scott Armitage

PyPE solution to PE problem 9

Blueprint information

Status:
Complete
Approver:
None
Priority:
Undefined
Drafter:
None
Direction:
Needs approval
Assignee:
None
Definition:
Approved
Series goal:
None
Implementation:
Implemented
Milestone target:
None
Started by
Scott Armitage
Completed by
Scott Armitage

Sprints

Whiteboard

    ProjectEuler.net problem 9
    ==========================

    A Pythagorean triplet is a set of three natural numbers, a b c, for which

        a^2 + b^2 = c^2

    For example, 3^2 + 4^2 = 9 + 16 = 25 = 5^2.

    There exists exactly one Pythagorean triplet for which a + b + c = 1000.
    Find the product abc.

    Solution
    --------

    We begin with some properties of right triangles, where c is the hypotenuse.
    We know that a+b+c=p (1) and a+b>c (2). Adding c to both sides of (2) and
    substituting into (1) we see that p>2c.

    Since p=1000, we have that c<=500, and since it is the longest side, we
    also have that a<=500 and b<= 500.

    Answer
    ------

    31875000

(?)

Work Items

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.