We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
Project Euler #21: Amicable numbers
Project Euler #21: Amicable numbers
Sort by
recency
|
66 Discussions
|
Please Login in order to post a comment
I believe (at least go) testcases incorrect, since for example we have pair 71145 - 67095, and if N is 7000, we should not consider both numbers, while testcase would be green only if you add 67095 but ignore 71145.
The amicable numbers are a well-studied sequecence, and a list of several of them can be found here. Technically, you could just use this list to find your result, but I encourage you to use them only for checking and testing your code. Otherwise, what's the point?
// C# using System; using System.Collections.Generic;
class Program { static int S(int n) { int sum = 1;
}