Back to Cosmos

Project Euler Problem #006: Sum square difference

code/online_challenges/src/project_euler/problem_006/README.md

latest787 B
Original Source

Project Euler Problem #006: Sum square difference

(Problem Link)

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

<p align="center"> 1<sup>2</sup> + 2<sup>2</sup> + ... + 10<sup>2</sup> = 385 </p> The square of the sum of the first ten natural numbers is, <p align="center"> (1 + 2 + ... + 10)<sup>2</sup> = 55<sup>2</sup> = 3025 </p> Hence 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 one hundred natural numbers and the square of the sum.


<p align="center"> A massive collaborative effort by <a href="https://github.com/OpenGenus/cosmos">OpenGenus Foundation</a> </p>