Вы попали на английскую версию сайта. Большая часть курсов доступна на русском языке

Sum of square Course Challenge: Intro to Programming

sumSquareDifference.js

The sum of the squares of the first ten natural numbers is 12 + 22 + 32 + ... + 10 2 = 385.

The square of the sum of the first ten natural numbers is (1 + 2 + 3 + ... + 10)2 = 552 = 3025.

Hence the difference between the square of the sum and the sum of the squares of the first ten natural numbers is 3025 − 385 = 2640.

Write the sumSquareDifference() function that takes argument n and returns the difference between the square of the sum and the sum of the squares of first n natural numbers.

Successful completion: 96%

For full access to the challenge you need a professional subscription.

A professional subscription will give you full access to all Hexlet courses, the opportunity to seek help from mentors and lifetime access to the theory of lessons learned. You can cancel your subscription at any time.

Get access
115
courses
892
exercises
2241
hours of theory
3196
tests

Last code review

User Updated at Submissions count
krivtsov 09 Mar 09:41 1