Satyarath wrote:
Test for divisibility by 7. Double the last digit and subtract it from the remaining leading truncated number. If the result is divisible by 7, then so was the original number. Apply this rule over and over again as necessary. Example: 826. Twice 6 is 12. So take 12 from the truncated 82. Now 82-12=70. This is divisible by 7, so 826 is divisible by 7 also.
Satyarath wrote:
Test for divisibility by 7. Double the last digit and subtract it from the remaining leading truncated number. If the result is divisible by 7, then so was the original number. Apply this rule over and over again as necessary. Example: 826. Twice 6 is 12. So take 12 from the truncated 82. Now 82-12=70. This is divisible by 7, so 826 is divisible by 7 also.
This is a test for divisibility by 7, not a rule. It works because a multiple of seven is subtracted repetitively from the tested number. Observe that in 826, 126 is subtracted from 826. 126 mod 7 is equivalent to 56. This is true for any final digit. It would be quick and easier to subtract 56 instead of 126 because the 5 may be deduced (all you must know is the seven times table), eliminating the need of multiplying by 2.
The application of a rule is quicker than performing division. Try to apply the test to N = 3,218,576,816. It will take approximately the double of the time used to perform division. If you try my rule, give it a chance!, it will take less than ten seconds!
Regarding divisibility by 8 consider abc the three final digits of N and calculate c' ≣ (4 .a + c) mod 8; eliminate "a" and you have c'd; if 8|c'd then 8|N.
Example: N 6954722; abc = 722; c' ≣ (4 . 7 + 2) mod 8 ≣ 6; c'd = 26; 8 does not divide 26 and 26 mod 8 ≣ 2 (remainder of N/8. I like this rule because it is quick and gives the remainder of the division.