Palindromic prime by darefilz

class P{static void Main(){for(int p,r,s,n=1;n<19992;++n){for(p=2,r=0,s=n;p<n;++p)if(n%p==0)break;if(p==n){while(s>0){r=r*10+s%10;s/=10;}if(r==n)System.Console.WriteLine(n);}}}}

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page