7 kyu
Difference Of Squares
429 of 7,371noku
Description:
Recreation of Project Euler problem #6
Find the difference between the square of the sum of the first n
natural numbers (1 <= n <= 100)
and the sum of their squares.
Example
For example, when n = 10
:
The square of the sum of the numbers is:
(1 + 2 + 3 + 4 + 5 + 6 + 7 + 8 + 9 + 10)² = 55² = 3025
The sum of the squares of the numbers is:
1² + 2² + 3² + 4² + 5² + 6² + 7² + 8² + 9² + 10² = 385
Hence the difference between square of the sum of the first ten natural numbers and the sum of the squares of those numbers is: 3025 - 385 = 2640
Fundamentals
Similar Kata:
Stats:
Created | Jun 28, 2015 |
Published | Jun 28, 2015 |
Warriors Trained | 9626 |
Total Skips | 702 |
Total Code Submissions | 14489 |
Total Times Completed | 7371 |
Ruby Completions | 429 |
JavaScript Completions | 3193 |
Python Completions | 2734 |
PHP Completions | 574 |
C# Completions | 497 |
Haskell Completions | 150 |
Prolog Completions | 10 |
Lua Completions | 10 |
C Completions | 28 |
Java Completions | 5 |
Total Stars | 43 |
% of votes with a positive feedback rating | 94% of 1265 |
Total "Very Satisfied" Votes | 1126 |
Total "Somewhat Satisfied" Votes | 120 |
Total "Not Satisfied" Votes | 19 |
Total Rank Assessments | 153 |
Average Assessed Rank | 7 kyu |
Highest Assessed Rank | 5 kyu |
Lowest Assessed Rank | 8 kyu |