Is there really no way to generate infinitely many primes?
A previous answer for someone asking about the Infinite generation of primes, says:
There is no exact way to generate primes continuously.
But, there's formulae for:
- A275669 (Numbers k such that 3*k-1 is composite)
- A046954 (Numbers k such that 6*k + 1 is nonprime.), a.k.a non-primes of the form 3m + 1.
And using the complements of those, you get "Numbers k such that 3k+-1 is prime".
What primes aren't generated by that sequence? Beyond the trivials of 2 and 3?
If you don't mean every prime, there are many ways to keep generating primes.
A trivial example, until a counterexample is shown, is OEIS A135508.
That sequence is said to generate only 1's and primes.
But if one considers only prime terms that occur at n=p-1, only distinct, monotonic prime numbers are generated.
Alternately, A135506 generates all primes (except 3) in sequence if one considers only those terms>prior terms.
There are similar methods by Bouras. Of course, efficiency is an entire different matter.