DIVISIBILITY BY 7
One interesting way (found in some books) is to take the two left-most digits, multiply the left digit by 3 and add it to the second digit. Replace these two digits with the result. Then we can keep repeating, always dealing with only the two left-most digits, until we end up with a small number which is either divisible by 7 or not. Pretend we have a two digit number, 10x+y. We multiply the left digit by 3 and add the second digit: 3x+y. All we did was just subtract 7x. If 3x+y is divisible by 7, then so is 10x+y. This works at the left end of a long number, too. The two left-most digits are 10x+y times some power of 10. Multiplying the left digit by 3 and adding the second digit gives us 3x+y times the same power of 10. And we subtracted off 7 times the same power of 10. Again, divisibility by 7 was not altered.
4712954379
1912954379
1212954379
512954379
162954379
92954379
29954379
15954379
8954379
3354379
1254379
554379
204379
64379
22379
8379
2779
1379
679
259
119
49
49 is divisible by 7. We could have stopped the process once we got a number that was small enough for my calculator, and divided the current number by 7. Since 49 is divisible by 7, every number above it is also divisible by 7.
Modular arithmetic gives us the following method. Start at the right digit, and go left. 1st digit + 3 times the 2nd digit + 2 times the 3rd digit - the 4th digit - 3 times the 5th digit - 2 times the 6th digit. And then we repeat the sequence, + the 7th digit + 3 times the 8th digit, etc. If the whole "sum" is divisible by 7, then the original number is divisible by 7.
4712954379
9+3(7)+2(3)-4-3(5)-2(9)+2+3(1)+2(7)-4=14
14 is divisible by 7. You can see that this is a much faster method. With really huge numbers, you might need to repeat the above steps.
I use a different method. I separate the huge number into 6-digit numbers (4712 954379), add them together (4712+954379=959091). I use my calculator to divide this by 7, and there is no remainder (959091/7=137013 with no remainder), so the original number is divisible by 7. With really huge numbers, I may have to repeat these steps. This method works for divisibility by 13, by the way. The above number is not divisible by 13. Why do we separate the number into 6-digit numbers? Well again, modular arithmetic produces that information. For divisibility by 37, we separate the long number into 3-digit numbers.
Source: http://www.jimloy.com/number/divis.htm