Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

A better implementation will only check to sqrt(n), as there can be no prime factor greater than that.


Yes, there can.


The point is that if there is a prime factor greater than sqrt(n), then your will have already found its co-factor by then.


Correct. I misspoke. I should have said,

A better implementation will only check to sqrt(n), as there can be no prime factor greater than that without there also being a prime factor lower than that.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: