PROBLEM LINK:Author: ADMIN Editorialist: SUSHANT AGARWAL DIFFICULTY:SIMPLE PREREQUISITES:Basic looping,Conditional statements PROBLEM:You will be given an integer N, 1 ≤ N ≤ 1000000. You must find the smallest integer M ≥ N such that M is a prime number and M is a palindrome. EXPLANATION:Check every odd number after N (using a loop) for 2 properties 1)It should be prime 2) The number should be equal to its reverse. Print the first number that satisfies these 2 properties and then break out of the loop when this number is encountered. EDITORIALIST'S SOLUTION:Editorialist's solution can be found here.
This question is marked "community wiki".
asked 18 Dec '14, 16:56

The solution given in this editorial is wrong. For the input of 10010 it gives output 10201 but rather it should be 10301 answered 21 Feb '15, 07:13

answer is right..10201 is smaller than 10301 answered 17 Apr '15, 01:07

why my solution is going for tle,.. http://www.codechef.com/viewsolution/6782096 answered 17 Apr '15, 01:17

10201 is divisible by 101 hence it is not a prime no Hence the awnser for 10010 is 10301 answered 25 Sep '15, 22:14

10201 is divisible by 101 hence it is not a prime no Hence the answer for 10010 is 10301 answered 25 Sep '15, 22:14

sir i have applied seive of atkins to found prime but still getting tle answered 20 Feb '16, 22:20

have u submitted it or checking it in codechef IDE? answered 20 Feb '16, 22:37

Serious issue  Editorialist's solution is wrong as output for 10000 is 10201 which is 101^2. This also means that the testcases are weak. answered 21 Jan, 19:26

Nice job, but please format your code if you want someone to be able to understand it easily  use for example this  http://prettyprinter.de/index.php
is not correct, M >= N right?