31 lines
678 B
Markdown
31 lines
678 B
Markdown
# Pythagorean Triplet
|
|
|
|
There exists exactly one Pythagorean triplet for which a + b + c = 1000. Find the product a * b * c.
|
|
|
|
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.
|
|
```
|
|
|
|
To run the tests simply run the command `go test` in the exercise directory.
|
|
|
|
If the test suite contains benchmarks, you can run these with the `-bench`
|
|
flag:
|
|
|
|
go test -bench .
|
|
|
|
For more detailed info about the Go track see the [help
|
|
page](http://help.exercism.io/getting-started-with-go.html).
|
|
|
|
## Source
|
|
|
|
Problem 9 at Project Euler [view source](http://projecteuler.net/problem=9)
|