P18042 [GeeksforGeeks] Next prime palindrome4153
普及-
题目描述

You will be given a positive integer N. Your task is to find the smallest number greater than or equal to N that is a prime and a palindrome.

Example 1:
Input: N = 12
Output: 101
Example 2:
Input: N = 4
Output: 5

Your Task:
You don't need to read or print anything. Your task is to complete the function PrimePalindrome() which takes N as input parameter and returns the smallest number greater than equal to N that is prime and palindrome.
Expected Time Complexity: O(N)
Expected Space Complexity: O(1)

Constraints:
1 <= N <= 10^{6}

输入格式

见题面

输出格式

见题面

样例输入
N = 12
样例输出
101