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

Rosetta Code has some examples of different methods and different languages. The most naïve way is trial division: http://rosettacode.org/wiki/Primality_by_trial_division


Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

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

Search: