3 ms·
It's kind of ironic that the python generator script uses modulo. The author could have pushed it to the point of not using one. I'm tempted to write a followu
by glandium 3y ago
It's kind of ironic that the python generator script uses modulo. The author could have pushed it to the point of not using one.
I'm tempted to write a followup doing even crazier things...
- eru 3y agoAuthor should have perhaps bootstrapped a script that doesn't use modulo?
- deleted 3y ago[deleted]
- layer8 3y agoClearly the solution is to factor each number and to (recursively) test the parity of the sum of the factors. Since all prime numbers other than 2 are known to be odd, the parity test for the case of a single factor is easy. You only need to special-case 4 to avoid an infinite recursion.
- ryanjshaw 3y agoI'm pretty sure that was an intentional joke. I do wish it'd have been a bitwise AND with 1.