## All even-digit Kaprekar Series numbers (base r) are multiples of (r - 1).

Let use consider a 2m-digit number(base r), whose digits are sorted in descending order:

```
n1 = r
```^{(2m - 1)} x_{1} + r^{(2m - 2)} x_{2} + ... + r^{(2m - i)} x_{i} + ... + r * x_{2m-1} + x_{2m}

sorted in ascending order, the number would be

```
n2 = r
```^{(2m - 1)} x_{2m} + r^{(2m - 2)} x_{2m-1} + ... + r^{(i - 1)} x_{i} + ... + r * x_{2} + x_{1}

The difference between the two numbers

```
Diff
```_{2m} = n1 - n2
= Σ_{(i = 1 to 2m)} r^{(2m - i)} x_{i} - Σ_{(i = 2m to 1)} r^{(i - 1)} x_{i}
= Σ_{(i = 1 to 2m)} {r^{(2m - i)} - r^{(i - 1)}} x_{i}
= Σ_{(i = 1 to m)} r^{(i - 1)} {r^{(2m - 2i + 1)} - 1} x_{i}
- Σ_{(i = m+1 to 2m)} r^{(2m - i)} {r^{(2i - 2m - 1)} - 1} x_{i}

* Where Σ stands for Sigma - the summation notation*

Lets take a closer look at part of the above expression

(2m - 2i + 1) is a positive number here when 1 <= i <= m

(2i - 2m - 1) is a positive number for m + 1 <= i <= 2m

So our task is reduced to proving that (r^{j} - 1) is divisible by (r - 1) for a positive j.

Let us assume that this is true for a positive j.

i.e. (r^{j} - 1) is divisible by (r - 1) for a positive j.

Consider the next number (j + 1). For this number, the expression changes to

```
(r
```^{(j+1)} - 1)
= r (r^{j} - 1) + (r - 1)

Now since (r^{j} - 1) is divisible by (r - 1), (r^{(j+1)} - 1) would also be divisible by (r - 1).

Lets consider the case of j = 1. For this value of j, the expression reduces to

```
r
```^{1} - 1 = (r - 1)

which obviously is divisible by (r - 1).

Hence, by mathematical induction, (r^{j} - 1) is divisible by (r - 1) for all positive integers.

Hence n2 - n1 is divisible by (r - 1) for all even-digit numbers. Since every number in the Kaprekar series is obtained by subtracting two numbers, with the same digits, sorted in descending and ascending orders; we come to the conclusion that all numbers in an even-digit Kaprekar series for a number in radix r is divisible by (r - 1).

## All odd-digit Kaprekar Series numbers (base r) are multiples of (r * r - 1).

Let use consider a 2m+1-digit number (base r), whose digits are sorted in descending order:

```
n1 = r
```^{2m} x_{1} + r^{(2m - 1)} x_{2} + ... + r^{(2m + 1 - i)} x_{i} + ... + r * x_{2m} + x_{2m+1}

sorted in ascending order, the number would be

```
n2 = r
```^{2m} x_{2m+1} + r^{(2m - 1)} x_{2m} + ... + r^{(i - 1)} x_{i} + ... + r * x_{2} + x_{1}

The difference between the two numbers

```
Diff
```_{2m+1} = n1 - n2
= Σ_{(i = 1 to 2m+1)} r^{(2m + 1 - i)} x_{i} - Σ_{(i = 2m+1 to 1)} r^{(i - 1)} x_{i}
= Σ_{(i = 1 to 2m+1)} {r^{(2m + 1 - i)} - r^{(i - 1)}} x_{i}
= Σ_{(i = 1 to m)} r^{(i - 1)} {r^{(2m - 2i + 2)} - 1} x_{i}
- Σ_{(i = m+2 to 2m+1)} r^{(2m + 1 - i)} {r^{(2i - 2m - 2)} - 1} x_{i}
= Σ_{(i = 1 to m)} r^{(i - 1)} {r^{2(m - i + 1)} - 1} x_{i}
- Σ_{(i = m+2 to 2m+1)} r^{(2m + 1 - i)} {r^{2(i - m - 1)} - 1} x_{i}

* Where Σ stands for Sigma - the summation notation*

Notice that (m - i + 1) >= 0 for 1 <= i <= m

And (i - m - 1) > 0 for m + 2 <= i <= 2m + 1

And that the expression is zero for i = m + 1

```
Diff
```_{2m+1} = n1 - n2

So, the problem is reduced to proving that (r^{2j} - 1) is divisible by (r * r - 1).

Lets assume that this is true for a positive j.

Lets consider the next number (j + 1). The expression for (j + 1) would be

```
r
```^{2(j+1)} - 1
= r^{2} (10^{2j} - 1) + r^{2} - 1

Since (r^{2j} - 1) is divisible by (r * r - 1), so the expression is divisible by (r * r - 1) for (j + 1) too.

Lets consider the case j = 1. The expression for this value is r^{2} - 1 = (r * r - 1). Which is obviously
divisible by (r * r - 1). Hence by mathematical induction, the expression is divisible by (r * r - 1) for all
positive integer j.

Hence n2 - n1 is divisible by 99 for all odd-digit numbers. Since every number in the Kaprekar series is obtained by subtracting two numbers, with the same digits, sorted in descending and ascending orders; we come to the conclusion that all numbers in an odd-digit Kaprekar series in radix r are divisible by (r * r - 1).