exercism/kotlin/difference-of-squares
2017-06-05 18:05:53 -04:00
..
.gradle Kotlin - Difference Of Squares Complete 2017-06-05 17:37:38 -04:00
.idea Kotlin - Acronym Complete 2017-06-05 18:05:53 -04:00
build Kotlin - Difference Of Squares Complete 2017-06-05 17:37:38 -04:00
src Kotlin - Difference Of Squares Complete 2017-06-05 17:37:38 -04:00
build.gradle Kotlin - Difference Of Squares Complete 2017-06-05 17:37:38 -04:00
difference-of-squares.iml Kotlin - Difference Of Squares Complete 2017-06-05 17:37:38 -04:00
README.md Kotlin - Difference Of Squares Complete 2017-06-05 17:37:38 -04:00

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.

Source

Problem 6 at Project Euler 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.