top of page

Problem 21
This is a C++ solution to Project Euler problem 21 found at: https://projecteuler.net/problem=21
My Algorithm
For this problem, we are asked to find the sum of all the amicable numbers under 10,000. An amicable pair is one such that two numbers, a and b, have d(a) = b and d(b) = a and a != b. d(n) is defined as the sum of the proper divisors of n. To solve this, we need to go through every number from 1 to 10,000 and find the sets of amicable pairs. Then, we can compare the two sums and see if they meet the specifications required in the prompts. If they do, then we will add them to a total sum and return the final answer of 31626.
Full Solution on GitHub
bottom of page