Hacker News new | past | comments | ask | show | jobs | submit login

it's nice. I'm way more dumbfounded by the prime thing though



Me too. I had to look it up. This page has pretty good breakdown:

https://itnext.io/a-wild-way-to-check-if-a-number-is-prime-u...

The main trick for me was you first have to convert the number to unary, which was done outside of the regex.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: