Draft

Sum Square Difference

Description:

The sum of the squares of the first ten natural numbers is:

1 * 1 + 2 * 2 + ... + 10 * 10 = 385

The square of the sum of the first ten natural numbers is:

(1 + 2 + ... + 10) * (1 + 2 + ... + 10) = 55 * 55 = 3025

The difference between the sum of the squares of the first ten natural numbers and the square of the sum is:

3025 − 385 = 2640

Find the difference between the sum of the squares of the first n natural numbers (n > 0) and the square of the sum, and then return the sum of the square of its digits.

e.g 2640 --> 2 * 2 + 6 * 6 + 4 * 4 + 0 * 0 = 56
Fundamentals
Algorithms
Mathematics

More By Author:

Check out these other kata created by jamsgra

Stats:

CreatedNov 7, 2017
Warriors Trained141
Total Skips19
Total Code Submissions150
Total Times Completed56
JavaScript Completions56
Total Stars2
% of votes with a positive feedback rating76% of 34
Total "Very Satisfied" Votes22
Total "Somewhat Satisfied" Votes8
Total "Not Satisfied" Votes4
Total Rank Assessments35
Average Assessed Rank
6 kyu
Highest Assessed Rank
6 kyu
Lowest Assessed Rank
8 kyu
Ad
Contributors
  • jamsgra Avatar
Ad