Regular Expression That Checks If a Number Is Prime (2016) (iluxonchik.github.io) 4 points by jagtodeath 6y ago ↗ HN
[–] jagtodeath 6y ago ↗ A python implementation of is_prime(n): return re.compile(r'^1?$|^(11+)\1+$').match('1' * n) is None
1 comment
[ 3.0 ms ] story [ 12.2 ms ] thread