Generating a random prime

225 Views Asked by At

How can I generate a random prime of the form $2^ab+1$ for small $b$ value without actually creating a list of such primes, and then choose from the list at random?

For example: I can generate a random n bit prime by choosing a random n bit integer $\textbf{c}$ from $[2^n,2^{n+1}],$ and then pick the next prime (or the previous prime) after $\textbf{c}.$

Does there exist such strategy for primes of the form $2^ab+1$? Any idea or suggestion will be greatly appreciated