4 ms·
On Division by Three (2023)
- tliltocatl 7mo agoSurprising that the author finds it surprising. In base-10 it's as easy as "a number is divisible by 3 or 9* iff sum of its digits is divisible", which is trivially independent of endiannes and slightly less trivial, but still possible, to check in O(1) extra space. * s/6/9/ Typo, thanks apothegm.
- apothegm 7mo agoTrue of 9 but not of 6 (trivial example of the latter: 36).
- deleted 7mo ago[deleted]