# Generate a prime number satisfying a condition

Building on the same context of this question

Is it possible to enforce constraints on the properties of the generated prime? For example, I'm trying to find a prime $p$ in the range specified in the question on top with the property that $5 \in QR_p$ which mean that there exists a number $x$ such that $x^2 \equiv 5\pmod p$

• I'd generate a number of primes, and then test each. – David G. Stork Jan 24 '18 at 20:03
• could you at least put your criteria in mathematica form? – george2079 Jan 24 '18 at 20:30

randprime[] := RandomPrime[{BitShiftLeft[2^^1001110011, 190],

984243528019146533777127966928980517167883028753863934494399