int main() { int n = 315; primeFactors(n); return 0; }
Luke Nguyen
>primeFactors
uuh sweetie you are missing something
Caleb Mitchell
just use miller rabin
Levi Ortiz
Oh sorry. u gay } }
Jace Russell
>running time is O(k log3n)
Jack Jenkins
k ought to be small though, and log^3n is still polynomial.
Matthew Turner
9 is not a prime number
Jaxson Wood
lol
Julian Long
The fastest would be to just dump a precomputed table of primes up to the number you want. We know all primes in the 64 bit integer range anyway.
Things get more interesting when your numbers are so big that they don't fit on conventional variables though. Can you devise a fast algorithm for computing primes up to arbitrarily large numbers?