You are viewing a single comment's thread. Return to all comments →
c#
public static int primeCount(long n)
{ int maxNum = 0; if (n == 1) { return maxNum; } List<ulong> primes = new List<ulong> {2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53}; ulong primeProd = 2; int i = 1; while (primeProd <= (ulong)n) { primeProd = primeProd * primes[i]; i++; maxNum++; } return maxNum; }
Seems like cookies are disabled on this browser, please enable them to open this website
Leonardo's Prime Factors
You are viewing a single comment's thread. Return to all comments →
c#
public static int primeCount(long n)