In case anyone's wondering how this works there is an explanation below :
1) pick a number from 1-10
1 2 3 4 5 6 7 8 9 10
2) subtract 5
-4 -3 -2 -1 0 1 2 3 4 5
3) multiply by 3
-12 -9 -6 -3 0 3 6 9 12 15
All multiples of 3 have their digits adding up to a multiple of 3.
4) multiply by the same number
144 81 36 9 0 9 36 81 144 225
This gets rid of the negatives and also ensures that everything can be written as X*(9).
example : 15^2 = (5*3)^2 = (5^2)*(3^2) = 25 * 9 = 225.
5) Sum the digits.
9 9 9 9 0 9 9 9 9 9
Multiples of 9 when they have their digits summed come out to a multiple of 9. When all the prime factors involved are