Settings

Theme

Regular Expression That Checks If a Number Is Prime (2016)

iluxonchik.github.io

4 points by jagtodeath 6 years ago · 1 comment

Reader

jagtodeathOP 6 years ago

A python implementation of is_prime(n):

  return re.compile(r'^1?$|^(11+)\1+$').match('1' * n) is None

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection