Day 25: Running Time and Complexity

  • + 2 comments

    One could also take advantage of the fact that all primes greater than 3 are of the form 6k+1 or 6k-1 (k=integer). This would take about sqrt(n)/3 modulo operations to test primality.