## All even-digit Kaprekar Series numbers are multiples of nine.

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

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

sorted in ascending order, the number would be

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

The difference between the two numbers

```
Diff
```_{2m} = n1 - n2
= Σ_{(i = 1 to 2m)} 10^{(2m - i)} x_{i} - Σ_{(i = 2m to 1)} 10^{(i - 1)} x_{i}
= Σ_{(i = 1 to 2m)} {10^{(2m - i)} - 10^{(i - 1)}} x_{i}
= Σ_{(i = 1 to m)} 10^{(i - 1)} {10^{(2m - 2i + 1)} - 1} x_{i}
- Σ_{(i = m+1 to 2m)} 10^{(2m - i)} {10^{(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 (10^{j} - 1) is divisible by 9 for a positive j.

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

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

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

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

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

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

```
10
```^{1} - 1 = 9

which obviously is divisible by 9.

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

Hence n2 - n1 is divisible by nine 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 is divisible by 9.

## All odd-digit Kaprekar Series numbers are multiples of ninety nine.

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

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

sorted in ascending order, the number would be

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

The difference between the two numbers

```
Diff
```_{2m+1} = n1 - n2
= Σ_{(i = 1 to 2m+1)} 10^{(2m + 1 - i)} x_{i} - Σ_{(i = 2m+1 to 1)} 10^{(i - 1)} x_{i}
= Σ_{(i = 1 to 2m+1)} {10^{(2m + 1 - i)} - 10^{(i - 1)}} x_{i}
= Σ_{(i = 1 to m)} 10^{(i - 1)} {10^{(2m - 2i + 2)} - 1} x_{i}
- Σ_{(i = m+2 to 2m+1)} 10^{(2m + 1 - i)} {10^{(2i - 2m - 2)} - 1} x_{i}
= Σ_{(i = 1 to m)} 10^{(i - 1)} {10^{2(m - i + 1)} - 1} x_{i}
- Σ_{(i = m+2 to 2m+1)} 10^{(2m + 1 - i)} {10^{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 (10^{2j} - 1) is divisible by 99.

Lets assume that this is true for a positive j.

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

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

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

Lets consider the case j = 1. The expression for this value is 10^{2} - 1 = 99. Which is divisible by 99. Hence by mathematical induction, the expression is divisible by 99 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 is divisible by 99.