If the sum of the digits in a number of any base add up to a multiple of the base minus one, then the original number is divisible by the base minus one.
Let N equal the number
Let B equal the base
Let S equal the sum of the digits
Let ax equal the digits or coefficients
Then:
| N = anBn+an-1Bn-1+...+a0B0 | Represent the number as the sum of powers times the coefficients. The number 12310 is one times ten squared plus two times ten to the first power plus three times ten to the zero power. (1)(102)+(2)(101)+(3)(100) |
| S = an+an-1+...+a0 | Add all the coefficients together to get the sum of the digits |
| N = an(Bn-1+1)+an-1(Bn-1-1+1)+...+a0(B0-1+1) | Add 1 and subtract 1 from the base - a trick with zero |
| N = an(Bn-1)+an+an-1(Bn-1-1)+an-1+...+a0(B0-1)+a0 | Distribute the coefficients across the +1 |
| N = an+an-1+...+a0+[an(Bn-1)+an-1(Bn-1-1)+...+a0(B0-1)] | Rearrange the number to separate the distributed coefficients with the remaining power sums |
| N = S+[an(Bn-1)+an-1(Bn-1-1)+...+a0(B0-1)] | Substitute S for the sum of the coefficients above |
| N = S+(B-1)Q | Factor the expresion in brackets. All (Bany power-1) are divisible by (B-1). The remaining quotient after the factorization is called Q |
| N = (B-1)T+(B-1)Q | If the sum of the digits S is divisible by (B-1), then S = (B-1)T |
| N = (B-1)[T+Q] | Factoring the expression we are left with the proof that if the sum of the digits of a number are divisible by the base minus one, the number is divisible by the base minus one |