3 ms·
This regex doesn't tell whether a number is prime, it tells whether the length of a specially crafted string is prime. Kind of a big difference as you can make
by bsdetector 8y ago
This regex doesn't tell whether a number is prime, it tells whether the length of a specially crafted string is prime.
Kind of a big difference as you can make a regex that answers any yes/no question if you preprocess the input enough.
- Fripplebubby 8y agoWell, saying that a number presented as unary isn't a number, to me, is the same as saying that a number presented as decimal isn't a number. But you're right that it is "specially crafted" rather than a general solution.