n=0 while n<1e4: n+=1;s=`sorted(`n`)`[2::5];r=s[::s>"1">n>9<s[0]==s[1]or-1];p=r[1:]+r[0] if p==p[::-1]:print p
Note that non-ascii characters in the above source code will be escaped (such as \x9f).
download
return to the top page