3 ms·
Any number whose digits sum up to a multiple of 3 (3,6,9) when summed until 1 digit remains; is a multiple of 3. Could this be something useful as a quick check
by nevi-me 11y ago
Any number whose digits sum up to a multiple of 3 (3,6,9) when summed until 1 digit remains; is a multiple of 3. Could this be something useful as a quick check for qualifying numbers?
I don't have any Assembly knowledge, but I presume that it wouldn't be efficient implementing this, because of having to cast to string, then back from string for each digit. Then the while loop to sum each digit.
Running the check only for odd numbers could also be an improvement.