main = do n <- readLn print (1!n) x!n|mod x n==0,s<-show x,reverse s==s=x|y<-x+1=y!n
16
272
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!