News for hackers. Stuff that matters.
Re:Divisibility by 7 by ahn on Sunday October 31, 2010 @04:01AM (#1852789)
You can generate rules like these for arbitrary integers/primes(much easier than trying to remember them in my opinion). Take 41.

Example: 1476 is divisible by 41? 147 - 4 * 6 = 123. 12 - 4 * 3 = 0. Yes.

Example: 3321 is divisible by 41? 332 - 4 * 1 = 328. 32 - 4 * 8 = 0. Yes

What's the rule? Take the last digit off, multiply by 4 and subtract.

How to find the rules is left as an exercise.

There are no comments on this comment yet.