# Ordering and Subtracting Process

Document Sample

```					             Locked Numbers
DJANGIR A. BABAYEV
(September, 2004)

1
Abstract

A natural number N, with not all digits same, generates numbers L(N) and S(N) by
reordering its digits in descending and ascending order. We call numbers N=L(N)-S(N)
locked numbers or integers. The work establishes existence of infinite number of locked
integers with even and odd number of digits. Structures of locked numbers, equivalent to
formulae, developed and proved valid for arbitrary locked numbers. They allow defining
explicitly locked integers of any given number of digits. Let T(N), with lower bound
Tmin(N), be the total number of locked integers among numbers up to N. Distribution of
T in ( N )
locked numbers revealed by establishing: T(1040)=661 and lim m 3             constant. Wide
N  ln ( N )

range of properties of locked numbers is established.

Key words

Ordering and Subtracting Recursion, Locked Numbers, Structure of Locked Numbers,
Distribution of Locked Numbers, Divisibility of Locked numbers,

2
Introduction.

In 1946 Kaprekar D.R. [4, 5] revealed, that if to reorder digits of a four-digit integer N in
descending and ascending orders, subtract the obtained smaller number S(N) from the
larger L(N), and apply this procedure repeatedly to the resulting remainder R(N)=L(N) -
S(N), then the number 6174 would result, which will not change in the following
iterations. Later other researchers considered this procedure for two digit [10], three-digit
[1], four-digit [2], five-digit [8] numbers and studied different aspects of the procedure
[3, 7, 9]. Results of ongoing research on Kaprekar cycles are presented in [6].
Only a finite number of integers have the given number of digits, because of that the
Ordering and Subtracting Recursion described above inevitably leads to a set of numbers,
which are repeated in some cycles, which may be different for different start numbers.
Another interesting result is that for a certain number of digits there are cycles of the
length equal to 1. In these cycles the remainder, as Karpekar’s number 6174, is repeated
and stays unchanged. In this work these numbers are called locked numbers or integers.
The paper investigates Ordering and Subtracting Recurrence and Locked Numbers. It is
established that an infinite number of locked numbers with even, as well as odd, number
of digits exist. Number of locked integers among first, not very large numbers, is small,
e.g., much less than, the number of primes: there are only 661 locked integers among
numbers up to 1040, to compare with more than 1038 primes. But with increasing
numbers the number of locked integers among them grows rapidly. Lower bound Tmin(N),
of the number of locked integers T(N) among the numbers up to a given N is obtained,
T in ( N )
which increases as ~ ln 3 N , when N increases infinitely large, lim m 3          constant.
N  ln ( N )

Only for three numbers of digits, primes 2, 5 or 7, there are no locked numbers.
Different structures of locked integers, equivalent to formulae, are given, which are valid
for integers with arbitrarily large number of digits, even and odd. These structures allow
defining explicitly locked integers of any given number of digits. It is shown that all
locked numbers are multiples of 9 and in the case of odd number of digits 99 divide them.

1. Formulation.
Notation.
N - a decimal integer with not all digits same.
L=L(N) – the integer obtained by ordering digits of N in descending order.
S=S(N) - the integer obtained by ordering digits of N in ascending order. L(N) and S(N)
are the largest and smallest numbers having the same set of digits as N.
R=R (N) = L(N) - S(N), remainder.

Definitions
Ordering and Subtracting step, or OS step consists of defining L(N), S(N) and R(N) for a
given N.
Ordering and Subtracting Recursion or OS Recursion is the repeated application of OS
step to a given number and corresponding OS remainders R(N):
1. Given N define N 1 =N and apply OS step to N 1 :
Define L( N 1 ) , S ( N 1 ) , R( N 1 ) = L( N 1 ) - S ( N 1 ) ;

3
2. Define N 2 = R( N 1 ) and apply OS step for N 2 :
In general OS Recursion consists of repeating OS step for consecutive N i , i=1,2,.…
Define L( N i ) , S ( N i ) , R( N i ) = L( N i ) - S ( N i ) and N i 1 = R( N i ) .

If a given number N has k last digits equal to zero, then S(N) starts with the same number
k zero digits, e.g., for N=25300, L(N)=53200 and S(N)=00235. To keep the number of
digits unchanged during OS Recursion these zeros are not dismissed as unnecessary, but
rather kept as other nonzero digits.
Integers with numbers of digits less than the original n may appear also in the OS
recursion. The remainder R( N i ) may have number of digits less than n, e.g., a four-digit
number N=4343 (n=4) implies L(N)=4433, S(N)=3344 and R(N)=89 (n=2). Similarly to
the above mentioned, this number in the following will be written as the four-digit
number 0089.
This allows all numbers generated in the OS Recursion to have the same number of
digits, which leads to a convenient uniformity of results.

If a given number N 1 =N is negative, then the remainder of the first step of OS
Recursion R( N 1 ) will be positive. Therefore, in the following only positive numbers N are
considered.

2. Cycling property of the OS Recursion and Locked Numbers
2.1. Cycles
As it is seen from the formulation of the OS Recursion it starts with a given number
N 1 =N and generates a sequence N 2 = R( N 1 ) , N 3 = R( N 2 ) ,…, N i 1 = R( N i ) ,….
All generated numbers have the same number of digits. For a given number n there are
only a finite number of different n-digit numbers, which means that at some step m some
of the generated numbers N i will be generated repeatedly, producing N m = N i and
starting from this number the subsequence of numbers from N i to N m will be repeated.
If continued the OS Recursion will cyclically generate the same subsequence of numbers,
with the length of the cycle equal to m-i+1.
The following is an example of a cycle for five-digits numbers.
Given N= 82962.
Step 1. N 1 =N;       L=98622, S=22689,            L-S = 75933,
2
Step 2. N =75933; L=97533, S=33579,                L-S = 63954,
3
Step 3. N =63954; L=96543, S=34569,                L-S = 61974,
4
Step 4. N =61974; L=97641, S=14679,                L-S = 82962.
1
The last remainder R coincides with N the length of cycle being 4.

2.2. Locked numbers.
A particular interesting case is cycles with the length equal to 1 step. In this case
N i = N i 1 = R( N i ) .
Definition. Number N coinciding with its OS remainder, N=R(N), is called a locked
number or integer.

4
Locked numbers are positive integers with not all digits alike. For example, it is easy to
check that N=864197532 is 9-digit locked number, because N=R(N).

This paper studies cycles and locked numbers with different number of digits by
analytical and enumerative methods.

3. Some general properties of locked numbers

Theorem 1a.
Every OS remainder and locked number is multiple of 9 and for odd number of digits they
are multiples of 99.
P r o o f.
Let L(N)= l1 l2 … ln , where l1 , l2 …, ln are digits of L(N).
By definition not all digits li are the same, then
l1  l2  …  ln ,                                                        (3.1)
and
l1 > ln .                                                               (3.2)
Further
L(N)= 10n1 l1 + 10n2 l2 +…+10 l n 1 + ln ,                                (3.3)
S(N)= 10n1 ln + 10n2 l n 1 +…+10 l2 + l1 ,                               (3.4)
An OS remainder R(N)= L(N)- S(N) in the Ordering and Subtracting Recurrence has the
structure
( 10n1 -1)* k 0 +( 10n2 - 101 )* k1 +( 10n3 - 102 ) k 2 +…,      (3.5)
where k i are nonnegative one digit numbers. Numbers of the form ( 10 r  10 s ), r  s are
non-negative integers, divided by 9, consequently, remainders (3.5) are divided by 9,
which completes the proof of the first claim of the theorem.
If n is odd, then the number ( 10n1 -1) consists of even (n-1) of 9-s, the next coefficient
( 10n2 - 101 ) contains first even (n-3) digits equal to 9 and the corresponding number of
zeros, etc. Similarly, all coefficients ( 10 r  10 s ) in (3.5) will have first even number of
digits equal to 9 followed by zeros. Numbers of this structure are divided by 99, and this
completes the proof of Theorem 1a.                                             

Theorem 1b.
The central digit of a locked number with odd number of digits is 9.

P r o o f.
The central digit of the number with odd number n=2k+1 of digits is rk 1 , where ri is the
i-th digit of the remainder, consequently, of the given number. By definition of the
remainder
rn = ln +10- l1 , because of (3.2). Then based on (3.1)
rn 1 = ln 1 -1+10- l2 ,…, rk 1 = lk 1 -1+10- lk 1 =9,

5
which shows that the central digit of an OS remainder, consequently, of a locked number,
with odd number of digits is 9, which proves Theorem 1b.                  
4. Two-digit numbers.
Theorem 2.
There are no two-digit locked numbers.
P r o o f.
A two digit number is presented as N= n1 n 2 , where n1 and n 2 are decimal digits of N.
By definition not all digits of the N are the same. Two cases are possible.
Case 1. n1 > n 2 . Then the largest and the smallest two numbers having the same set of
digits are
L(N)= n1 n 2 and S(N)= n 2 n1 .
If N is a locked number, then R(N)= L(N)- S(N) = n1 n 2 - n 2 n1 =N= n1 n 2 . But this is
impossible, because S(N )= n 2 n1 >0.
Case 2. n 2 > n1 . In this case R(N)= L(N)- S(N)= n 2 n1 - n1 n 2 = N= n1 n 2 . From here
n 2 n1 = 2 n1 n 2 or 10 n 2 + n1 = 20 n1 +2 n 2 and further 8 n 2 =19 n1 . The last equation has
no solution in one-digit integers and this completes the proof.                                  
Theorem 2 shows that for a given two-digit integer OS Recursion cannot end with a
number, which stays unchanged in Ordering and Subtracting Recursion.

5. Three-digit numbers.
Theorem 3.
There is a unique three-digit locked number 495.
P r o o f.
Consider a three-digit number N with L= l1 l2 l3 , where l1 , l2 and l3 are digits of L.
By definition not all digits l1 , l2 and l3 are the same, then
l1  l2  l3                                                                 (5.1)
and
l1 > l3 .                                                                     (5.2)
From Theorem 1b, r2 =9, but this is the largest digit, consequently l1 =9.
From (5.1) S = l3 l2 l1 . Subtracting S from L digitwise leads to
r3 = l3 +10- l1 ,                                                            (5.3)
r2 = l2 -1+10- l2 =9,                                                        (5.4)
r1 = l1 -1- l3 .                                                            (5.5)
Assume N is a locked number, then R(N) and L have the same set of digits.
r1 + r3 =9.                                                                    (5.6)
With l1 and r2 defined, we have that pairs ( r1 , r3 ) and ( l2 , l3 ) have the same set of digits.
Consider the first of two possible alternatives
- r1 = l2 and r3 = l3 . This contradicts to (5.3) r3 = l3 +1.
- The second alternative is r1 = l3 and r3 = l2 .

6
Substituting l3 = r1 into (4.3) gives
r3 = r1 +1.                                                                  (5.7)
Solving system (5.6), (5.7) gives the unique solution r1 =4 and r3 =5, i.e., N= r1 r2 r3 =495,
which proves Theorem 3.                                           
Continue analysis the case n=3 aiming to answer the question: what cycles can occur in
Ordering and Subtracting Recursion with three digit numbers?
For an arbitrary three-digit number if L= l1 l2 l3 , then
L=100 l1 +10 l2 + l3 and
S=100 l3 +10 l2 + l1 .
From here
R =L-S = 99( l1 - l3 ),                                               (5.8)
where
l1 - l3 >0, consequently R can have only 9 different values all multiples of 99:
R = 99, 198, 297, 396, 495, 594, 693, 792, 891.                    (5.9)
For any given number N an OS step will give a remainder with one of possible 9 values
in (5.9).
Consider the process for different values of the remainder:
Case 1. R =594; L=954, S=459, L-S =495;
Case 2. R =693; L=963, S=369, L-S =594;
Case 3. R =792; L=972, S=279, L-S =693;
Case 4. R =891; L=981, S=189, L-S =792;
Case 5. R =099; L=990, S=099, L-S =891;

In case 1 after one step the remainder is R =495. Application of the OS step to this
number, L=954, S=459 yields again L-S = 495, i.e., R(N) =N, is a locked integer and it
will stay unchanged in the subsequent steps.
Case 2 in one step is reduced to case 1. Consequently, in case 2 after two steps the
remainder is 495. Similarly each of cases 3, 4 and 5 in one step of OS Recurrence is
reduced to the preceding case, consequently, in case 3, 4 and 5 after three, four and five
steps, correspondingly, the remainder is 495,
Consider the left values of R in (5.9).
R=495 does not need to be reduced as in the considered cases.
Because of the ordering part of the OS Recurrence, the following pairs are equivalent
with the same set of digits and remainder (198, 891), (297, 792), (396, 693).
This completes the analysis of all possible cases and establishes:

Application of Ordering and Subtracting Recurrence to any three-digit number leads in
at most 6 steps to a unique locked number 495.                                  

6. Four-digit numbers, n=4.
Theorem 4.
There is a unique four-digit locked number 6174.
P r o o f.

7
Let L(N) = l1 l2 l3 l4 , where l1 , l2 , l3 and l4 are digits of L(N) for a given number N, with
l1  l2  l3  l4                                                                 (6.1)
and
l1 > l4 .                                                                          (6.2)
Then S = l4 l3 l2 l1 . Subtracting S from L digit wise leads to
r4 = l4 +10- l1 ,                                                              (6.3)
r3 = l3 -1+10- l2 ,                                                            (6.4)
Similar equations for r2 and r1 depend on whether l2 = l3 , or l2 > l3 . Consider
Case 1. Assumption l2 = l3 .
r2 = l2 -1+10- l3 ,                                                            (6.5`)
r1 = l1 -1- l4 .                                                               (6.6`)
Based on the assumption l2 = l3 equations (6.4) and (6.5`) correspondingly imply
r3 =9 and r2 =9. This means l1 = l2 =9 and further l3 = 9 based on the assumption of
Case 1, l3 = 9. From Theorem 1 the locked number is a multiple of 9, consequently 9
should divide the sum of its digits. This refers to digits of L(N) too, because R(N) and
L(N) have the same set of digits. Then l4 must be equal to 9 or 0. By definition all digits
of the locked number cannot be the same, this leaves the single possibility l4 =0. But then
(6.3) imply r4 =1, and 1 {9,9,9,0} the set of digits of L. Contradiction shows that the
assumption of Case 1 is not valid, i.e., l2 > l3 .
In this case equations (6.5`)- (6.6`) are replaced by
r2 = l2 -1- l3 ,                                                             (6.5)
r1 = l1 - l4 .                                                                (6.6)
System (6.3), (6.4), (6.5), (6.6) includes 8 integer variables li , ri , i=1, 2, 3, 4 with
0  li , ri  9, i=1, 2, 3, 4;
4              4

 li =
i 1
r
i 1
i   and divided by 9;

Sets of digits of R(N) and L(N) are the same, i.e.,
{ l1 , l2 , l3 , l4 }={ r1 , r2 , r3 , r4 }                                           (6.7)
Condition (6.7) means that for each i there is a j with ri = l j , i, j=1, 2, 3, 4.
This condition can be modeled by introducing an additional set of variables xij  {0, 1},
with the meaning xij =1 corresponds to ri = l j . These new variables together with ri and
l j satisfy constraints
4
ri =  l j x ij , i=1, 2, 3, 4,                                                           (6.8)
j 1
4

x
j 1
ij   =1, i=1, 2, 3, 4,                                                                (6.9)

8
4

x
i 1
ij   =1, j=1, 2, 3, 4,                                                         (6.10)

Constraints (6.9)-(6.10) correspond to a (4x4) binary matrix { xij }, with exactly one
element equal to1 in each column and each row. There are 4! =24 such matrices. By
preliminary analysis some of these matrices, i.e., solutions to (6.9)-(6.10), can be
eliminated from further considerations as infeasible.
Consider x22 =1, which corresponds to r2 = l2 . Then (6.5) implies l3 +1=0, which is
infeasible. From here x22 =0 in all feasible solutions. This excludes 6 of 24 solutions of
(6.9)-(6.10).
Further, if x44 =1, then r4 = l4 and (6.3) implies l1 =10, which is impossible l1 being a
digit. This eliminates five more additional solutions of (6.9)-(6.10). Leaving only 13
different solutions to enumerate. Each solution { xij } is substituted into (6.8) and
generates four equations ri = l j , i, j=1, 2, 3, 4, thus reducing to four the number of
variables in system of four equations (6.3)-(6.6). This system is solved and the solution is
checked for conditions (6.1), with l2  l3 replaced by l2 > l3 .
Completing this procedure reveals that there is only one solution satisfying all conditions,
r1 = l2 =6, r2 = l4 =1, r3 = l1 =7, r4 = l3 =4, which corresponds to N =R(N)=6174.
This completes proof of Theorem 4.                                             
7. 5-digit numbers.
5-digit numbers can be analyzed similar to 4-digit numbers.
Let l1 , l2 , l3 , l4 and l5 be digits of L(N) for the given number N, with
l1  l2  l3  l4  l5                                          (7.1)
and
l1 > l5 .                                                          (7.2)
Theorem 1b implies r3 =9 and consequently, l1 =9. So, there are four variables ri and four
variables li to be defined. From here 5-digit numbers can be analyzed similar to 4-digit
numbers. In the case of n=5 similarly to the case of n=4, from two alternatives l2 = l4 or
l2 > l4 the first is infeasible and this leads to the system
r5 = l5 +10- l1 ,                                                            (7.3)
r4 = l4 -1+10- l2 ,                                                         (7.4)
r2 = l2 - l4 ,                                                               (7.5)
r1 = l1 - l5 .                                                               (7.6)

Variables r3 and l1 being known the counterpart of the system (6.8)-(6.10) reduces to
4
ri =  l j x ij , i=1, 2, 4, 5,                                                   (7.7)
j 1
5

x
j 2
ij    =1, i=1, 2, 4, 5,                                                      (7.8)

9
5

x
i 1
ij   =1, j= 2, 3, 4, 5.                                                       (7.9)
i 3

Analysis of all possible solutions of the system (7.2)-(7.9) reveals that there is no feasible
solution among them. This establishes

Theorem 5. There is no 5-digit locked number.                         

8. Structures of locked numbers of arbitrary number of digits.

As it was mentioned above for three- and four-digit numbers OS Recurrence ends with
the unique locked integer, 495 and 6174, correspondingly, independently of the starting
number. But for higher numbers of digits this pattern is not valid. For example, for 6-digit
numbers two different locked integers exist, (Table 1), but depending on the start number
the process may lead also to other cycles containing more than one step, e.g., the starting
number 666665 leads to cycle containing 6 steps.
As in the case of 5-digit numbers there are no locked numbers among 7-digit numbers
and OS Recurrence for them ends in different cycles depending on the start number.
All numbers having 8 or more digits have locked numbers among them and OS
Recurrence may end in one of them or at different cycles with more than one step
depending on the start number.

The following Theorems 6 to 11 establish existence of small number of structures of
locked numbers. The developed structures cover all existing locked integers among
numbers up to 10 32 and generate locked numbers having arbitrarily large number of
digits. Theorems 6 to 13 establish existence of infinite number of locked numbers of the
presented structures. These structures, S1, S2,… allow obtaining the locked numbers
explicitly.

Theorem 6, (Structure S1, n  3).
For any k  1, 3k-digit number of the structure N = 55… 4 99… 44… 5
k-1        k      k-1
is a locked number.
Note. Structure of the integer number, presented as in the Theorem 6 means:
the first (k-1) digits of the number are 5-s. The next one digit is 4, then follow k digits
equal to 9, then (k-1) digits are equal to 4, with the last digit being 5.
P r o o f. An integer of the presented structure has three different digits:
k digits are equal to 9, k-1+1=k digits equal to 5 and the left k digits are fours. Then
L(N)= 99… 55… 44… and S(N)= 44… 55… 99…
k       k     k                   k       k      k
Based on these structures of L(N) and S(N) define R(N) = L(N)-S(N) by digitwise
subtracting:
The last digit of R(N) is 4+10-9=5. The next digit to the left is 4-1+10-9=4. The next k-2
digits are obtained similarly and equal to 4. The next digit is 5-1+10-5=9. This will be
repeated k times. The next one digit is obtained as 9-1-4 = 4. Finally the utmost left k-1
digits are defined as 9-4=5, showing R(N) = N, which proves the Theorem.                

10
Theorem 6 can be rephrased as:
There is a locked number for any given number of digits, which is a multiple of three.

Corollary 6. 1. There are an infinite number of locked numbers with number of digits
divided by three.
P r o o f. The Corollary is implied by Theorem 6.                               
The following Theorem establishes one structure for locked numbers of even number of
digits.
Theorem 7, (Structure S2, n  4).
For any k  2, 2k-digit number of the structure N = 6 33… 1 7 66… 4 is a locked
number.                                                k-2     k -2

P r o o f. The theorem is proved as the previous Theorem 6: Given N define
R(N)=L(N)-S(N) by digitwise subtracting to verify, that it coincides with N.       

Theorem 7 can be rephrased as:
There is a locked number for any even number (larger than 2) of digits.

Corollary 7. 1. There are an infinite number of locked numbers with even number of
digits.
P r o o f. The Corollary is implied by Theorem 7.                              
Examples are presented in Table 1.

There are locked numbers of odd number of digits, not necessarily divided by three; they
have structure different from Theorem 6.

Theorem 8, (Structure S3, n  9, ).
For any k  4, (2k+1)-digit number of the structure
N = 864 33… 197 66… 532 is a locked number.
k -4       k-4

P r o o f.
The theorem is proved by the same approach as in the proof of Theorems 6.        
A locked number of this structure has the number of digits 9 or higher.
Theorem 8 can be rephrased as:
There is a locked number for any odd number of digits larger than 7, prime or composite.

In view of Theorem 6 note that number of digits in this structure can also be multiple of
three.
Corollary 8. 1. There are an infinite number of locked numbers with odd number of
digits.
P r o o f. The Corollary is implied by Theorem 8.                                  

11
Based on Theorems 6, 7 and 8 one can define locked numbers for infinitely high number
of digits. For example, consider number of digits 12, which is divided by two and three.
Then there are at least two 12-digit locked integers 555499994445, by Theorem 6 and
633331766664, by Theorem 7.
Theorems 6, 7 and 8 present one-parameter (k) structures for locked numbers. With
increasing the number of digits diversity of structures of locked numbers increases as
well as their total number. New structures emerge different from those presented in
Theorems 6, 7 and 8. Some of these structures for even and odd number of digits are
described by using two or more parameters, as in the following Theorems.

Theorem 9, (Structure S4, n  8).
For any k  m  4+3l, l  0, n=2k-digit number of the structure
N = 9 99… 77… 75 55… 33… 11… 08 88… 66… 44… 42 22… 00… 1
m-q    l        l k –m l           l    k-m l           l m-q
is a locked number. Here q=4+3l.

P r o o f.
The proof is similar to the proof of Theorem 6.                           
Each set of parameters (k, m, l) satisfying the condition of the Theorem generates one
locked number of the given structure.

Theorem 10, (Structure S5, n  16). For any k  8+m+l, l  0, m  0, n=(2k+1)-digit
number of the structure
N = 9 99… 87654 33… 20987 66… 54321 00…1
m             l            l           m
is a locked number.
P r o o f.
The proof is similar to the proof of Theorem 6.                          
Each set of parameters (k, m, l) generates one locked number of the given structure.

Theorem 11, (Structure S6, n  18). For any k  9+m, m  0, 2k-digit number of the
structure
N = 886644 33… 219977 66… 553312
m               m
is a locked number.
P r o o f.
The proof is similar to the proof of Theorem 6.                         
Each set of parameters (k, m ) generates one locked number of the given structure.

Structures with small number of parameters as S3 and S6 are convenient to work with.
But in many cases they are special cases of more general structures. For example, the
following statement is valid

Theorem 12, (Structure S7, n  9).
For any k  0, r  0 , m  0, with condition if k>0 then m = k , r+1 ≥ k,
n=(9r+12k+2m+9)-digit number of structure

12
8 88.. 77.. 6 66.. 55.. 4 44.. 33.. 22.. 1 9 99.. 7 77.. 66.. 5 55.. 44.. 3 33.. 22.. 11.. 2
r 2k         r k        k+r m k+r          r+2k k+r m         k+r k        r 2k r

is a locked number.

This structure alone generates all locked numbers generated by structures S3 and S6 and
some more.
P r o o f.
The proof is obtained using the digitwise subtracting as in the proof of Theorem 6. 

Note that structure S7 generates locked numbers with both even and odd number of
digits.
Another multi-parameter structure is given by

Theorem 13, (Structure S8, n  8).
For any r  0, q  0, m  0, l  0, n=(6r+9q+2m+2l+8)-digit number of structure
999.. 88..777.. 66..555.. 44.. 33.. 22.. 1.. 099.. 888.. 77.. 66.. 55.. 444.. 33..222.. 11.. 00..1
m q       r q        r q l         q    r    q     r     q l      q     r q       r    q m
is a locked number. This structure generates locked numbers generated by structures S4
and S5.
P r o o f.
Proved as Theorem 12.                                                                    
Structure S8 also generates locked numbers with both even and odd number of digits.

Structures S1-S8 cover all existing locked numbers up to 1050. As an example Table 1
presents all existing locked numbers with numbers of digits up to 20. Each of them has
one of structures S1-S6 with corresponding values of k and values of parameters m and l,
also presented in Table 1.
After introducing more general structures S7 and S8 all locked numbers up to 1050 are
described by only four structures, S1, S2, S7 and S8.

9. Number of locked integers.
Summarizing results of Sections 3 to 8 implies:
For not very large numbers, number of locked numbers is small, e.g., much less than the
number of primes. There are only 660 locked integers among numbers up to1040 in
comparison with more than 1038 primes.

Let t(n) be the number of n-digit locked integers. For an arbitrary n number t(n) is not
known. For n  50 all existing locked numbers were calculated straightforwardly based
on their definition by this author, for n  20 they also presented in [6].
The structures developed in Theorems 6 to Theorem 11 imply the lower bound for t(n),
tm in (n)  t(n). For n  50 these bounds coincide with the exact value of t(n), tm in (n) =
t(n).

13
Lower bound tm in (n) for each n is calculated as the sum of locked numbers generated by
the developed structures of locked numbers given in the corresponding Theorems 6 to 11,
as the following:
Denote t s (n) number of n-digit locked integers generated by structure of Ss,
s=1, 2,…,6. Then
t1 (n) =1 for each n=3k, k  1;
t2 (n) =1 for each n=2k, k  2;
t3 (n) =1 for each n=2k+1, k  4;
3                                               k  4
t4 (n) = (k-3)(r+1) -    r(r+1), for each n=2k, k  m  4+3l, where r=        .
2                                                3  
(k  7)(k  6)
t5 ( n) =                for each n=2k+1, k  8+m+l;
2
t6 (n) = k-8 for each n=2k, k  9+m;

Lower bound tm in (n) of the number of all n-digit locked integers is defined as
6
tm in (n)=  t s (n)                                                                      (9.1)
s 1

Denote T(n) total number T(n) of locked numbers among numbers up to 10n
Table 2 presents number of existing locked numbers with number of digits n and their
sum T(n). For numbers of digits presented in Table 2, tm in (n) = t(n).

For large numbers of n, e.g., n>50, tm in (n) can be estimated from (9.1) and presents
for even number of digits, n=2k,
3
t m inev (n) = t2 (n) + t4 (n) + t6 (n) = 1+(k-3)(r+1) - r(r+1)+k-8;                      (9.2)
2
k  4                      k 4
For purposes of estimating t m inev (n) value r=              is approximated as r= 3 . Then
 3 
5 2                   5 n2
t m inev (n) =        k +a`k+b`=             +an+b                                (9.3)
18                    18 4
n
where k= , a`, a ,b` and b are constants.
2
For odd number of digits, n=2k+1,
(k  7)(k  6) n 2
t m in od ( n) = t1 (n) + t3 (n) + t5 (n) =1+1+               =    +cn+d,       (9.4)
2         16
n 1
where k=               , c and d are constants.
2
For large numbers the lower bounds for the total number of locked integers among all
numbers up to 10n can be obtained as the sum of corresponding numbers for even and
odd number of digits,

14
n              n
5           1
Tm in (n)=    tm inev (m) +  tm inod (m) =
m2              m 3           18 *12
n3 +
16 * 3
n3 + n 2  n   ,    (9.5)

where  ,  and  are constants. This expression is transformed as
19 3
Tm in (n)=       n + n 2  n   .
432
ln N
If N= 10n , then n=logN=             , where log and ln decimal and natural logarithms, and the
ln 10
last expression is transformed into
19                    ln 2 N    ln N
Tm in (n)=          3
ln 3 N +  2 +               +  . From here
432 * ln 10                ln 10     ln 10
T (N )         19
lim min3      =                 =constant.                                    (9.6)
N  ln N        432 * ln 3 10
This proves
Theorem 14.
The number of locked integers among the large numbers N grows as ln 3 N , or
equivalently, as n 3 , where n is the number of digits of N.                        
10. Conjecture
Results presented in this work give a basis for the following conjecture about the locked
numbers

Conjecture: The first digit N1 of the locked number cannot be less than 4. If the number
of digits larger than three, then N1 >4.

Conclusion
A number-theoretic Ordering and Subtracting Recursion is considered and analyzed
for integers with arbitrary number of digits.
Step of the Recursion consists of reordering digits of a given natural number N in
ascending and descending order and subtracting the smaller number from the larger. Then
the step is repeated for the remainder. The recurrence leads to cycles, in which the values
of the remainder are repeated.
The notion of the locked number is introduced. Locked number is equal to its remainder
in one step of the Ordering and Subtracting Recursion. The locked number corresponds to
the cycle consisting of one step and cannot be changed by this Recursion.
It is established that an infinite number of locked integers with even and odd number of
digits exist. The number of locked integers among the not very large numbers is small,
e.g., much less than the number of primes: as a comparison there are only 661 locked
integers among numbers up to 1040 to compare to ~1038 primes. But with increasing
numbers the number of locked integers among them grows rapidly. Lower bound of the
number of locked integers among the numbers up to a given N is obtained, which
T in ( N )
increases as ~ ln 3 N , when N increases infinitely large, i.e., lim m 3         constant.
N  ln ( N )

15
Several different structures of locked numbers, equivalent to formulae, are given, they
cover all existing locked numbers up to 10 32 and each of them defines locked numbers
explicitly for a given arbitrary number of digits.
It is proved that no locked number exists for numbers of digits equal to 2, 5 and 7.
It is shown that all locked numbers are divided by 9; if number of digits is odd, then 99
divides them, and the central digit of any locked number with odd number of digits is 9.
A conjecture is formulated: the first digit of any locked number having more than three
digits is larger than four.

Acknowledgement

The author is grateful to Professor Urfat Nuriyev of Ege University, Izmir, Turkey, who
carried out all programming and computations related to numbers higher than 1010 .

16
REFERENCES

[1] K. E. Eldridge, S. Sagong, S. (1988) The Determination of Kaprekar Convergence
and Loop Convergence of All 3-Digit Numbers, Amer. Math. Monthly 95, (1988) 105-
112.

[2] N. Hasse, G. D. Prichett, The Determination of All Four-digit Kaprekar Constants, J.
Reine Angew. Math. (1978) 113-124.

[3] J. H. Jordan, Self-Producing Sequences of Digits, Amer. Math. Monthly 71 (1964)
61-64.

[4] D. R. Kaprekar, “Another Solitaire Game”, Scripta Math. 15 (1949) 244-245.

[5] D. R. Kaprekar, “An Interesting property of the number 6174”, Scripta Math. 21
(1955) 304.

[6] Kaprekar Series Generator, http://kaprekar.sourceforge.net

[7] J.F. Lapenta, A.L. Ludington, G. D. Prichett, Algorithm to Determine Self Producing
r-Digit g-Adic Integers. J. Reine Angew. Math. 310 (1979) 100-110

8. G. D. Prichett, Terminating Cycles for Iterated Difference Values of Five-digits
Integers” J. Reine Angew. Math. 303/304 (1978) 379-388.

[9] G. D. Prichett, A.L. Ludington, J.F. Lapenta, The Determination of All Decadic
Kaprekar Constants” Fibonacci Quarterly 19.1 (1981) 45-52

[10] C. W. Trigg, Kaprekar’s Routine with Two-digit integers”, Fibonacci Quarterly 9.2
(1971) 189-193.

17
Table 1. Existing locked integers with number of digits n  20
Number of          Number of       Locked integers, Theorems, structures and
digits n and       existing        parameters m and l
parameter k        locked
integers
2                  None                                        Theor 2
3          k=1     One              495                        Theor 3, S1
4          k=2     One              6174                       Theor 4, S2
5                  None                                        Theor 5
6          k=2     Two              549945,                    S1
k=3                      631764                     S2
7                  None             Established by enumeration
8         k=4      Two             63317664,                   S2
k= 4                     97508421        m =4, l=0 S4
9         k= 3     Two             554999445,                  S1
k= 4                     864197532                   S3
10        k=5      Three           6333176664,                 S2
k=5                      9753086421, m =4, l=0 S4
k=5                      9975084201 m =5, l=0 S4
11        k=5      One             86431976532                  S3
12        k=4      5               555499 994445;               S1
k= 6                     633331 766664;               S2
k= 6                     975330 866421 m =4, l=0 S4
k= 6                     997530, 864201 m =5, l=0 S4
k= 6                     999750, 842001 m =6, l=0 S4
13         k=6     One             8643319766532                S3
14         k=7     6               6333331 7666664                 S2
k=7                     9753330 8666421 m =4, l=0       S4
k=7                     9975330 8664201 m =5, l=0       S4
k=7                     9997530 8642001 m =6, l=0       S4
k=7                     9999750 8420001 m =7, l=0       S4
k=7                     9775510 8844221 m =7, l=1        S4
15         k=5     Two             5555499 99944445                     S1
k=7                     8643331 97666532                     S3
16         k=8     8               63333331 76666664                    S2
k=8                     97533330 86666421 m=4, l=0           S4
k=8                     99753330 86664201 m=5, l=0           S4
k=8                     99975330 86642001 m =6, l=0          S4
k=8                     99997530 86420001 m =7, l=0          S4
k=8                     99999750 84200001 m =8, l=0          S4
k=8                     97755310 88644221 m =7, l=1           S4
k=8                     99775510 88442201 m = 8, l=1          S4
17         k=8     Two             86433331 976666532                    S3
k=8                     98765420 987543211 m=0, l=0           S5

18
18   k=6    12      555554999999444445             S1
k=9            633333331766666664             S2
k=9            975333330866666421 m=4, l=0    S4
k=9            997533330866664201 m=5, l=0    S4
k=9            999753330866642001 m =6, l=0   S4
k=9            999975330866420001 m =7, l=0   S4
k=9            999997530864200001 m =8, l=0   S4
k=9            999999750842000001 m =9, l=0   S4
k=9            977553310886644221 m =7, l=1  S4
k=9            997755310886442201 m = 8, l=1 S4
k=9            999775510884422001 m = 9, l=1 S4
k=9            886644219977553312 m=0        S6
19   k=9    Three   8643333319766666532            S3
k=9            9876543209876543211, m=0, l=1 S4
k=9            9987654209875432101 m=1, l=0 S4
20   k=10   14      63333333317666666664            S2
k=10           97533333308666666421 m=4, l=0 S4
k=10           99753333308666664201 m=5, l=0 S4
k=10           99975333308666642001 m=6, l=0 S4
k=10           99997533308666420001 m=7, l=0 S4
k=10           99999753308664200001 m=8, l=0 S4
k=10           99999975308642000001 m=9, l=0 S4
k=10           99999997508420000001 m=10, l=0 S4
k=10           97755333108866644221 m=7, l=1 S4
k=10           99775533108866442201 m=8, l=1 S4
k=10           99977553108864422001 m=9, l=1 S4
k=10           99997755108844220001 m=10, l=1 S4
k=10           97775551108884442221 m=10, l=2 S4
k=10           88664432199776553312 m=1       S6

19
Table 2. Number t(n) of locked integers with number of digits n and total number T(n) of
locked integers among numbers up to 10n
n        t(n)     T(n)                        n      t(n)       T(n)
1        ---      ---                         21     5          70
2        0        0                           22     17         87
3        1        1                           23     7          94
4        1        2                           24     21         115
5        0        2                           25     8          123
6        2        4                           26     25         148
7        0        4                           27     12         160
8        2        6                           28     30         190
9        2        8                           29     14         204
10       3        11                          30     36         240
11       1        12                          31     17         257
12       5        17                          32     43         300
13       1        18                          33     21         321
14       6        24                          34     49         370
15       2        26                          35     25         395
16       8        34                          36     58         453
17       2        36                          37     31         484
18       12       48                          38     66         550
19       3        51                          39     36         586
20       14       65                          40     75         661

20
21

```
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
 views: 8 posted: 2/5/2010 language: English pages: 21