Skip to content

Instantly share code, notes, and snippets.

@voroninman
Created February 6, 2016 17:07
Show Gist options
  • Save voroninman/85c671975fa138e83642 to your computer and use it in GitHub Desktop.
Save voroninman/85c671975fa138e83642 to your computer and use it in GitHub Desktop.
import re;p=lambda n:not re.match(r'^1?$|^(11+?)\1+$','1'*n)
d=lambda s:s==s[::-1]
def golf(n):
while 1:
n+=1
if p(n)*d(str(n)):return n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment