Stack Exchange network consists of 183 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
n=12n=9 while n<2e8: n+=1 if`n`in`range(n%10,0,~n%100%11-11)`[-2::-3]:print n n+=1
Takes about 3 minutes locally.
Try it online!Try it online! (modified to print all numbers but the last)
n=12 while n<2e8: if`n`in`range(n%10,0,~n%100%11-11)`[-2::-3]:print n n+=1
Try it online! (modified to print all numbers but the last)
n=9 while n<2e8: n+=1 if`n`in`range(n%10,0,~n%100%11-11)`[-2::-3]:print n