On the generalized divisibility rules page, a method was shown for creating a method to check for divisibility by any number. It was noted that some of these rules can get complicated, especially for prime numbers other than 2, 3, and 5. For example, to check for divisibility by 17, the method is:
Evaluate 1 times the ones digit − 7 times the tens digit − 2 times the hundreds digit − 3 times the thousands digit + 4 times the ten thousands digit + 6 times the hundred thousands digit − 8 times the millions digit + 5 × the ten millions digit − 1 times the hundred millions digit + 7 times the billions digit + 2 times the ten billions digit + 3 times the hundred billions digit − 4 times the trillons digit − 6 times the ten trillions digit + 8 times the hundred trillions digit − 5 times the quadrillions digit + 1 times the ten quadrillions digit and so on, with the pattern of numbers repeating. If that sum is divisible by 17, the number is also divisible by 17.
Let's try a different type of divisibility test for these numbers. Take 7, for example:
To test for divisibility by 7, remove the last digit from the number, and then subtract twice that digit from the remaining number. Repeat the process until you are left with a number that you can check for divisibility by 7 visually. If this number is divisible by 7, then the original number is as well.
So, if you're testing whether 89,313 is divisible by 7:
Here are some other rules you can use to test divisibility by some other prime numbers:
I'll add some content later showing how to justify these procedures and how to create your own for other prime numbers shortly.
Sources used (see bibliography page for titles corresponding to numbers): 39.