Take an Alternating Sum of Digits

To see if a is divisible by 11, alternately add and subtract the digits of a starting from the right; this alternating sum and a leave the same remainder when divided by 11. As in the previous section, we can extend this idea to blocks of digits. For instance, a is divisible by 91 if and only if the alternating sum of blocks of 3 digits is divisible by 91. To see if 23210481381 is divisible

by 91 we consider 381

481 + 210

23 = 87. Clearly 87 is not divisible by

91, so neither is 23210481381.

Alternating

Sum

of

Digits

Trick:

Let d be given, and suppose that

10n

≡

1

(mod d) for some n.

Alternately add and subtract the digits of

a in blocks of n starting from the right, and call the result s. Now a and s leave the same remainder upon division by d; in particular, a is divisible by

d if and only if s is divisible by d.

Below are the values of d (2 ≤ d ≤ 102) for which the alternating sum blocks are at most 4.