Prime numbers constraint

In reply to pradeepD:

You want the numbers to be BCD ( 17 , 37 , 47 etc … )

So each digit would be represented in 4-bits .

Your question is how do I make LSB part as 7 , I gave you the solution to achieve it

The lowest digit is always 7 by constraint LSB_7