top of page

Problem 06

This is a C++ solution to Project Euler problem 06 found at: https://projecteuler.net/problem=6

My Algorithm

For this problem, we need to find the difference between the sum of the squares of the first one hundred natural numbers and the square of the sum. To do this, we will create a for-loop that adds all the numbers and their squares together. Then, after the for-loop, we just need to square the sum. Finally, we can subtract the sum squared from the squared sum to get our answer of 25164150.

Full Solution on GitHub

© 2023 by Matthew Woodring

    bottom of page