This commit is contained in:
Dan Ballard 2014-08-22 07:46:24 -07:00
parent 7bf2f073d7
commit 967163b950
1 changed files with 21 additions and 0 deletions

21
e3/e3.cs Normal file
View File

@ -0,0 +1,21 @@
using System;
using System.Collections.Generic;
using System.Linq;
public class E3 {
public static List<long> 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<long> {n};
}
public static void Main() {
System.Console.WriteLine(factor(600851475143).Max());
}
}