Skip to content

Instantly share code, notes, and snippets.

@betodealmeida
Created July 30, 2021 17:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save betodealmeida/ad5b11cdd893dbbaeaaf49f33d6a68cc to your computer and use it in GitHub Desktop.
Save betodealmeida/ad5b11cdd893dbbaeaaf49f33d6a68cc to your computer and use it in GitHub Desktop.
import re
def is_prime(n):
return not re.match(r'^.?$|^(..+?)\1+$', '1'*n)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment