Skip to content

Instantly share code, notes, and snippets.

@dkarbayev
Last active February 10, 2018 03:46
Show Gist options
  • Select an option

  • Save dkarbayev/c34171fa41fd138ed1b3 to your computer and use it in GitHub Desktop.

Select an option

Save dkarbayev/c34171fa41fd138ed1b3 to your computer and use it in GitHub Desktop.
Find smallest prime palindrome that is larger than n
def g(n):
n+=1
while`n`[::-1]!=`n`or any(n%j<1 for j in range(2,n)):n+=1
return n
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment