Back to the Problem
Check the string palindrome first (cheap), then √-trial-division primality.
Complexity: O(√N) or better