To test divisibility by ...

the number of ending digits to examine

2, 5, 10 4, 20, 25, 50, 100 8, 40 16, 80 32 64

1 2 3 4 5 6

Ending Digits Trick: Suppose that d divides 10^{n }for some n. Then d divides a number a if and only if d divides the last n digits of a.

The following table shows all the numbers d from 2 to 102 that divide a power of 10, and the number of ending digits one must check to determine divisibility by d.

Why it works: Suppose that 10^{n }is divisible by d, or in other words, 10^{n }≡ 0 (mod d). Let a be a number with k digits, and assume that k ≥ n.

a = [a a

1

a 1 a 0 ]

= 10^{n}[a a

1

a_{n}] + [a_{n }_{1 }

a_{0}]

≡ [a_{n 1 }

a_{0}]

(mod d)

Consequently, d divides a if and only if d divides the last n digits of a, namely,

[a_{n 1 }

a_{0}].

Running total: We now have divisibility tests for 2, 4, 5, 8, 10, 16, 20, 25, 32, 40, 50, 64, 80, 100.

3.2

# Take a Sum of the Digits

It is well known that a number a is divisible by 3 or 9 if and only if the sum of the digits of a is divisible by 3 or 9, respectively. More generally, we can

5