From ff662e72997f80c940ddb6f08b032a05f8f4f285 Mon Sep 17 00:00:00 2001 From: Dimitri Sokolyuk Date: Thu, 25 Aug 2016 04:01:30 +0200 Subject: difference-of-squares --- go/difference-of-squares/README.md | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 go/difference-of-squares/README.md (limited to 'go/difference-of-squares/README.md') diff --git a/go/difference-of-squares/README.md b/go/difference-of-squares/README.md new file mode 100644 index 0000000..8022e2a --- /dev/null +++ b/go/difference-of-squares/README.md @@ -0,0 +1,34 @@ +# Difference Of Squares + +Find the difference between the sum of the squares and the square of the sums of the first N natural numbers. + +The square of the sum of the first ten natural numbers is, + + (1 + 2 + ... + 10)**2 = 55**2 = 3025 + +The sum of the squares of the first ten natural numbers is, + + 1**2 + 2**2 + ... + 10**2 = 385 + +Hence the difference between the square of the sum of the first +ten natural numbers and the sum of the squares is 2640: + + 3025 - 385 = 2640 + +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://exercism.io/languages/go). + +## Source + +Problem 6 at Project Euler [http://projecteuler.net/problem=6](http://projecteuler.net/problem=6) + +## Submitting Incomplete Problems +It's possible to submit an incomplete solution so you can see how others have completed the exercise. + -- cgit v1.2.3