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

In J generating prime numbers is simply p:21, that gives you 79 which is the 21st prime number.

It is so fast, I wonder what the algorithm behind it is.

[0]: https://code.jsoftware.com/wiki/Vocabulary/pco



> I wonder what the algorithm behind it is.

Noted in the details section of the link you provided:

"Primality testing on numbers larger than (2^31) uses the probabilistic Miller-Rabin algorithm."


How high can you go with this?


I have J on my android phone, and the highest I could go was

p: 100999999, the prime numbers is 2059519669




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

Search: