Java solution 6ms
\nclass Solution {\n    public int primePalindrome(int N) {\n        if (N == 1 || N == 2) return 2;\n        if (N % 2 == 0) N++;\n        while (true) {\n    
```\nclass Solution {\n    public int primePalindrome(int N) {\n        if (N == 1 || N == 2) return 2;\n        if (N % 2 == 0) N++;\n        while (true) {\n            if (isPalindrome(N) && isPrime(N)) return N;\n            N += 2;\n            if (10_000_000 < N && N < 100_000_000)\n                N = 100_000_001;\n        }\n    }\n    \n    private boolean isPalindrome(int n) {\n        if (n % 10 == 0 && n != 0) return false;\n        int n1 = 0;\n        while (n > n1) {\n            n1 = n1 * 10 + (n % 10);\n            n /= 10;\n        }\n        return n1 == n || n == n1 / 10;\n    }\n    \n    private boolean isPrime(int n) {\n        int end = (int)Math.sqrt(n);\n        for (int i = 3; i <= end; i += 2) {\n            if (n % i == 0) return false;\n        }\n        return true;\n    }\n}\n```
[]