I want to generate a prime $p$ of a certain size $2^{k}$ divides $p-1$ for some $k < p$. Is there any trick that I can use to do that instead of a brute-force search?
Tell me more
×
Mathematics Stack Exchange is a question and answer site for
people studying math at any level and professionals in related fields. It's 100% free, no registration required.
|
|
The following Java program found one in a fraction of a second:
Output from one run:
And for good measure, here are ones of size 80 and 160 (after I filtered out a couple of tries where the first few bits happened to be 0s):
For some less random examples, $13\times 2^{316}+1$ is also prime, as are $29\times 2^{75}+1$ and $315\times 2^{151}+1$. |
|||||||||
|