diff --git a/e3/e3.cs b/e3/e3.cs new file mode 100644 index 0000000..0d891cc --- /dev/null +++ b/e3/e3.cs @@ -0,0 +1,21 @@ +using System; +using System.Collections.Generic; +using System.Linq; + +public class E3 { + public static List factor(long n) { + for (long i = 2; i < Math.Sqrt(n); i++) { + if (n % i == 0) { + return factor(n/i).Concat(factor(i)).ToList(); + } + } + return new List {n}; + } + + public static void Main() { + + System.Console.WriteLine(factor(600851475143).Max()); + } +} + +