n=input();r=0while n:r+=1;k=t=1;exec't&=(r/k/10*k+r%k)%(r/k%10or r)<1;k*=10;'*r;n-=tprint r
24
155
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!