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 #23: Non-abundant sums
Project Euler #23: Non-abundant sums
Sort by
recency
|
48 Discussions
|
Please Login in order to post a comment
JavaCode
//C# using System; using System.Collections.Generic;
class Result { public static bool IsAbundant(int n) { int sum = 1; // 1 is a proper divisor for all numbers for (int i = 2; i * i <= n; i++) { if (n % i == 0) { sum += i; if (i != n / i) // avoid counting the same divisor twice for perfect squares sum += n / i; } } return sum > n; }
}
class Solution { public static void Main(string[] args) { int t = Convert.ToInt32(Console.ReadLine().Trim()); List results = new List();
}
c# using System; using System.Collections.Generic;
public class Program { static List primes = new List { 2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47 }; static List abundants = new List();
}