linguistic:paraphrasing
Proof using modular arithmetic

This section will illustrate the basic method; all the rules can be derived following the same procedure. The following requires a basic grounding in modular arithmetic; for divisibility other than by 2's and 5's the proofs rest on the basic fact that 10 mod m is invertible if 10 and m are relatively prime.

For 2 or 5:

Only the last n digits need to be checked.

Representing x as 10 n ⋅ y + z, {\displaystyle 10^{n}\cdot y+z,}

and the divisibility of x is the same as that of z.

For 7:

Since 10 × 5 ≡ 10 × (−2) ≡ 1 (mod 7) we can do the following:

Representing x as 10 ⋅ y + z, {\displaystyle 10\cdot y+z,}

so x is divisible by 7 if and only if y − 2 z is divisible by 7.