Sha256: d2edea6fe196a0f053ecb0293d939ca20a50f08075821f11d27715c94b470a60
Contents?: true
Size: 1.08 KB
Versions: 167
Compression:
Stored size: 1.08 KB
Contents
# Difference Of Squares Find the difference between the square of the sum and the sum of the squares of the first N natural numbers. The square of the sum of the first ten natural numbers is (1 + 2 + ... + 10)² = 55² = 3025. The sum of the squares of the first ten natural numbers is 1² + 2² + ... + 10² = 385. Hence the difference between the square of the sum of the first ten natural numbers and the sum of the squares of the first ten natural numbers is 3025 - 385 = 2640. For installation and learning resources, refer to the [exercism help page](http://exercism.io/languages/groovy). Run the tests by executing the test script. ``` $ groovy ./DifferenceOfSquaresSpec.groovy ``` After the first test(s) pass, continue by commenting out or removing the `@Ignore` annotations prepending other tests. When all tests pass, congratulations! ## Source Problem 6 at Project Euler [http://projecteuler.net/problem=6](http://projecteuler.net/problem=6) ## Submitting Incomplete Solutions It's possible to submit an incomplete solution so you can see how others have completed the exercise.
Version data entries
167 entries across 167 versions & 1 rubygems