by readerrrr · 12y ago · 0 comments
n^2+n+41
It doesn't generate sequential primes.That doesn't really matter, checking if a number is prime can be done in sublinear time complexity. The real problem is factoring large numbers.
https://en.wikipedia.org/wiki/Formula_for_primes#Prime_formu...
n
which also doesn't give a prime for any n, but does generate them all.
In reality you will use a O( (log n)^6 ) algorithm.
11 also works initially as a constant, but it degrades even more quickly than 41.