Python3 program to find next palindromic prime for a given number .
import math as mt NEW_LINE def isPrime ( num ) : NEW_LINE INDENT if ( num < 2 or num % 2 == 0 ) : NEW_LINE INDENT return num == 2 NEW_LINE DEDENT for i in range ( 3 , mt . ceil ( mt . sqrt ( num + 1 ) ) ) : NEW_LINE INDENT if ( num % i == 0 ) : NEW_LINE INDENT return False NEW_LINE DEDENT DEDENT return True NEW_LINE DEDENT def primePalindrome ( N ) : NEW_LINE