S[p] denote the sum of digits of
p. A prime
p is said to be stubborn if none of
S[n] + 1,
S[n] - 1,
S[n] - 2 , or
S[n] - 3 is a prime. Write a mathematica code that finds the smallest stubborn prime and tell which prime is it?
Here is a direct approach:
This was quite sufficient in this case. For larger search spaces see Iterate until condition is met.