You may have heard of the rule of thumb that if the sum of the decimal digits of a number value is divisible by 3, the number value itself is also divisible by 3. I will try to explain why that is. Mind you, this is not a mathematical proof, because I’m not skilled enough for that.

Now, let’s look at a number value, expressed as a decimal value:

43210

This is the same as:

4×10⁴ + 3×10³ + 2×10² + 1×10¹ + 0×10⁰

More generally, a number value expressed as a decimal value is the same as:

x = ∑_{k=0..n} {d_{k} × 10^{k}} . . . [1]

Because 10 = 1 + 9, we can rewrite [1] as follows:

x = ∑_{k=1..n} {d_{k} × 10^{k-1}} + 9 × ∑_{k=1..n} {d_{k} × 10^{k-1}} + d_{0} . . . [2]

9 × a is divisible by 3 for any whole number value of a, and if x is divisible by 3, x – 9 × a, is also divisible by 3. Hence, if we define x_{0} as follows:

x_{0} = x – 9 × ∑_{k=1..n} {d_{k} × 10^{k-1}} . . .[3]

then if x is divisible by 3, x_{0} should also be divisible by three. Let’s substitute [2] into [3]:

x_{0} = ∑_{k=1..n} {d_{k} × 10^{k-1}} + d_{0} . . . [4]

If we redo this “trick”, we get:

x_{1} = ∑_{k=2..n} {d_{k} × 10^{k-2}} + d_{1} + d_{0} . . . [5]

Doing this several times, we will get:

x_{n} = ∑_{k=0..n} {d_{k}} . . . [6]

meaning, that if x is divisible by 3, the sum of its decimal digits should be divisible by 3 as well.

That is all.