- Source: Kaprekar number
In mathematics, a natural number in a given number base is a
p
{\displaystyle p}
-Kaprekar number if the representation of its square in that base can be split into two parts, where the second part has
p
{\displaystyle p}
digits, that add up to the original number. For example, in base 10, 45 is a 2-Kaprekar number, because 45² = 2025, and 20 + 25 = 45. The numbers are named after D. R. Kaprekar.
Definition and properties
Let
n
{\displaystyle n}
be a natural number. Then the Kaprekar function for base
b
>
1
{\displaystyle b>1}
and power
p
>
0
{\displaystyle p>0}
F
p
,
b
:
N
→
N
{\displaystyle F_{p,b}:\mathbb {N} \rightarrow \mathbb {N} }
is defined to be the following:
F
p
,
b
(
n
)
=
α
+
β
{\displaystyle F_{p,b}(n)=\alpha +\beta }
,
where
β
=
n
2
mod
b
p
{\displaystyle \beta =n^{2}{\bmod {b}}^{p}}
and
α
=
n
2
−
β
b
p
{\displaystyle \alpha ={\frac {n^{2}-\beta }{b^{p}}}}
A natural number
n
{\displaystyle n}
is a
p
{\displaystyle p}
-Kaprekar number if it is a fixed point for
F
p
,
b
{\displaystyle F_{p,b}}
, which occurs if
F
p
,
b
(
n
)
=
n
{\displaystyle F_{p,b}(n)=n}
.
0
{\displaystyle 0}
and
1
{\displaystyle 1}
are trivial Kaprekar numbers for all
b
{\displaystyle b}
and
p
{\displaystyle p}
, all other Kaprekar numbers are nontrivial Kaprekar numbers.
The earlier example of 45 satisfies this definition with
b
=
10
{\displaystyle b=10}
and
p
=
2
{\displaystyle p=2}
, because
β
=
n
2
mod
b
p
=
45
2
mod
1
0
2
=
25
{\displaystyle \beta =n^{2}{\bmod {b}}^{p}=45^{2}{\bmod {1}}0^{2}=25}
α
=
n
2
−
β
b
p
=
45
2
−
25
10
2
=
20
{\displaystyle \alpha ={\frac {n^{2}-\beta }{b^{p}}}={\frac {45^{2}-25}{10^{2}}}=20}
F
2
,
10
(
45
)
=
α
+
β
=
20
+
25
=
45
{\displaystyle F_{2,10}(45)=\alpha +\beta =20+25=45}
A natural number
n
{\displaystyle n}
is a sociable Kaprekar number if it is a periodic point for
F
p
,
b
{\displaystyle F_{p,b}}
, where
F
p
,
b
k
(
n
)
=
n
{\displaystyle F_{p,b}^{k}(n)=n}
for a positive integer
k
{\displaystyle k}
(where
F
p
,
b
k
{\displaystyle F_{p,b}^{k}}
is the
k
{\displaystyle k}
th iterate of
F
p
,
b
{\displaystyle F_{p,b}}
), and forms a cycle of period
k
{\displaystyle k}
. A Kaprekar number is a sociable Kaprekar number with
k
=
1
{\displaystyle k=1}
, and a amicable Kaprekar number is a sociable Kaprekar number with
k
=
2
{\displaystyle k=2}
.
The number of iterations
i
{\displaystyle i}
needed for
F
p
,
b
i
(
n
)
{\displaystyle F_{p,b}^{i}(n)}
to reach a fixed point is the Kaprekar function's persistence of
n
{\displaystyle n}
, and undefined if it never reaches a fixed point.
There are only a finite number of
p
{\displaystyle p}
-Kaprekar numbers and cycles for a given base
b
{\displaystyle b}
, because if
n
=
b
p
+
m
{\displaystyle n=b^{p}+m}
, where
m
>
0
{\displaystyle m>0}
then
n
2
=
(
b
p
+
m
)
2
=
b
2
p
+
2
m
b
p
+
m
2
=
(
b
p
+
2
m
)
b
p
+
m
2
{\displaystyle {\begin{aligned}n^{2}&=(b^{p}+m)^{2}\\&=b^{2p}+2mb^{p}+m^{2}\\&=(b^{p}+2m)b^{p}+m^{2}\\\end{aligned}}}
and
β
=
m
2
{\displaystyle \beta =m^{2}}
,
α
=
b
p
+
2
m
{\displaystyle \alpha =b^{p}+2m}
, and
F
p
,
b
(
n
)
=
b
p
+
2
m
+
m
2
=
n
+
(
m
2
+
m
)
>
n
{\displaystyle F_{p,b}(n)=b^{p}+2m+m^{2}=n+(m^{2}+m)>n}
. Only when
n
≤
b
p
{\displaystyle n\leq b^{p}}
do Kaprekar numbers and cycles exist.
If
d
{\displaystyle d}
is any divisor of
p
{\displaystyle p}
, then
n
{\displaystyle n}
is also a
p
{\displaystyle p}
-Kaprekar number for base
b
p
{\displaystyle b^{p}}
.
In base
b
=
2
{\displaystyle b=2}
, all even perfect numbers are Kaprekar numbers. More generally, any numbers of the form
2
n
(
2
n
+
1
−
1
)
{\displaystyle 2^{n}(2^{n+1}-1)}
or
2
n
(
2
n
+
1
+
1
)
{\displaystyle 2^{n}(2^{n+1}+1)}
for natural number
n
{\displaystyle n}
are Kaprekar numbers in base 2.
= Set-theoretic definition and unitary divisors
=The set
K
(
N
)
{\displaystyle K(N)}
for a given integer
N
{\displaystyle N}
can be defined as the set of integers
X
{\displaystyle X}
for which there exist natural numbers
A
{\displaystyle A}
and
B
{\displaystyle B}
satisfying the Diophantine equation
X
2
=
A
N
+
B
{\displaystyle X^{2}=AN+B}
, where
0
≤
B
<
N
{\displaystyle 0\leq B
X
=
A
+
B
{\displaystyle X=A+B}
An
n
{\displaystyle n}
-Kaprekar number for base
b
{\displaystyle b}
is then one which lies in the set
K
(
b
n
)
{\displaystyle K(b^{n})}
.
It was shown in 2000 that there is a bijection between the unitary divisors of
N
−
1
{\displaystyle N-1}
and the set
K
(
N
)
{\displaystyle K(N)}
defined above. Let
Inv
(
a
,
c
)
{\displaystyle \operatorname {Inv} (a,c)}
denote the multiplicative inverse of
a
{\displaystyle a}
modulo
c
{\displaystyle c}
, namely the least positive integer
m
{\displaystyle m}
such that
a
m
=
1
mod
c
{\displaystyle am=1{\bmod {c}}}
, and for each unitary divisor
d
{\displaystyle d}
of
N
−
1
{\displaystyle N-1}
let
e
=
N
−
1
d
{\displaystyle e={\frac {N-1}{d}}}
and
ζ
(
d
)
=
d
Inv
(
d
,
e
)
{\displaystyle \zeta (d)=d\ {\text{Inv}}(d,e)}
. Then the function
ζ
{\displaystyle \zeta }
is a bijection from the set of unitary divisors of
N
−
1
{\displaystyle N-1}
onto the set
K
(
N
)
{\displaystyle K(N)}
. In particular, a number
X
{\displaystyle X}
is in the set
K
(
N
)
{\displaystyle K(N)}
if and only if
X
=
d
Inv
(
d
,
e
)
{\displaystyle X=d\ {\text{Inv}}(d,e)}
for some unitary divisor
d
{\displaystyle d}
of
N
−
1
{\displaystyle N-1}
.
The numbers in
K
(
N
)
{\displaystyle K(N)}
occur in complementary pairs,
X
{\displaystyle X}
and
N
−
X
{\displaystyle N-X}
. If
d
{\displaystyle d}
is a unitary divisor of
N
−
1
{\displaystyle N-1}
then so is
e
=
N
−
1
d
{\displaystyle e={\frac {N-1}{d}}}
, and if
X
=
d
Inv
(
d
,
e
)
{\displaystyle X=d\operatorname {Inv} (d,e)}
then
N
−
X
=
e
Inv
(
e
,
d
)
{\displaystyle N-X=e\operatorname {Inv} (e,d)}
.
Kaprekar numbers for
F
p
,
b
{\displaystyle F_{p,b}}
= b = 4k + 3 and p = 2n + 1
=Let
k
{\displaystyle k}
and
n
{\displaystyle n}
be natural numbers, the number base
b
=
4
k
+
3
=
2
(
2
k
+
1
)
+
1
{\displaystyle b=4k+3=2(2k+1)+1}
, and
p
=
2
n
+
1
{\displaystyle p=2n+1}
. Then:
X
1
=
b
p
−
1
2
=
(
2
k
+
1
)
∑
i
=
0
p
−
1
b
i
{\displaystyle X_{1}={\frac {b^{p}-1}{2}}=(2k+1)\sum _{i=0}^{p-1}b^{i}}
is a Kaprekar number.
X
2
=
b
p
+
1
2
=
X
1
+
1
{\displaystyle X_{2}={\frac {b^{p}+1}{2}}=X_{1}+1}
is a Kaprekar number for all natural numbers
n
{\displaystyle n}
.
= b = m2k + m + 1 and p = mn + 1
=Let
m
{\displaystyle m}
,
k
{\displaystyle k}
, and
n
{\displaystyle n}
be natural numbers, the number base
b
=
m
2
k
+
m
+
1
{\displaystyle b=m^{2}k+m+1}
, and the power
p
=
m
n
+
1
{\displaystyle p=mn+1}
. Then:
X
1
=
b
p
−
1
m
=
(
m
k
+
1
)
∑
i
=
0
p
−
1
b
i
{\displaystyle X_{1}={\frac {b^{p}-1}{m}}=(mk+1)\sum _{i=0}^{p-1}b^{i}}
is a Kaprekar number.
X
2
=
b
p
+
m
−
1
m
=
X
1
+
1
{\displaystyle X_{2}={\frac {b^{p}+m-1}{m}}=X_{1}+1}
is a Kaprekar number.
= b = m2k + m + 1 and p = mn + m − 1
=Let
m
{\displaystyle m}
,
k
{\displaystyle k}
, and
n
{\displaystyle n}
be natural numbers, the number base
b
=
m
2
k
+
m
+
1
{\displaystyle b=m^{2}k+m+1}
, and the power
p
=
m
n
+
m
−
1
{\displaystyle p=mn+m-1}
. Then:
X
1
=
m
(
b
p
−
1
)
4
=
(
m
−
1
)
(
m
k
+
1
)
∑
i
=
0
p
−
1
b
i
{\displaystyle X_{1}={\frac {m(b^{p}-1)}{4}}=(m-1)(mk+1)\sum _{i=0}^{p-1}b^{i}}
is a Kaprekar number.
X
2
=
m
b
p
+
1
4
=
X
3
+
1
{\displaystyle X_{2}={\frac {mb^{p}+1}{4}}=X_{3}+1}
is a Kaprekar number.
= b = m2k + m2 − m + 1 and p = mn + 1
=Let
m
{\displaystyle m}
,
k
{\displaystyle k}
, and
n
{\displaystyle n}
be natural numbers, the number base
b
=
m
2
k
+
m
2
−
m
+
1
{\displaystyle b=m^{2}k+m^{2}-m+1}
, and the power
p
=
m
n
+
m
−
1
{\displaystyle p=mn+m-1}
. Then:
X
1
=
(
m
−
1
)
(
b
p
−
1
)
m
=
(
m
−
1
)
(
m
k
+
1
)
∑
i
=
0
p
−
1
b
i
{\displaystyle X_{1}={\frac {(m-1)(b^{p}-1)}{m}}=(m-1)(mk+1)\sum _{i=0}^{p-1}b^{i}}
is a Kaprekar number.
X
2
=
(
m
−
1
)
b
p
+
1
m
=
X
1
+
1
{\displaystyle X_{2}={\frac {(m-1)b^{p}+1}{m}}=X_{1}+1}
is a Kaprekar number.
= b = m2k + m2 − m + 1 and p = mn + m − 1
=Let
m
{\displaystyle m}
,
k
{\displaystyle k}
, and
n
{\displaystyle n}
be natural numbers, the number base
b
=
m
2
k
+
m
2
−
m
+
1
{\displaystyle b=m^{2}k+m^{2}-m+1}
, and the power
p
=
m
n
+
m
−
1
{\displaystyle p=mn+m-1}
. Then:
X
1
=
b
p
−
1
m
=
(
m
k
+
1
)
∑
i
=
0
p
−
1
b
i
{\displaystyle X_{1}={\frac {b^{p}-1}{m}}=(mk+1)\sum _{i=0}^{p-1}b^{i}}
is a Kaprekar number.
X
2
=
b
p
+
m
−
1
m
=
X
3
+
1
{\displaystyle X_{2}={\frac {b^{p}+m-1}{m}}=X_{3}+1}
is a Kaprekar number.
Kaprekar numbers and cycles of
F
p
,
b
{\displaystyle F_{p,b}}
for specific
p
{\displaystyle p}
,
b
{\displaystyle b}
All numbers are in base
b
{\displaystyle b}
.
Extension to negative integers
Kaprekar numbers can be extended to the negative integers by use of a signed-digit representation to represent each integer.
See also
Arithmetic dynamics
Automorphic number
Dudeney number
Factorion
Happy number
Kaprekar's constant
Meertens number
Narcissistic number
Perfect digit-to-digit invariant
Perfect digital invariant
Sum-product number
Notes
References
D. R. Kaprekar (1980–1981). "On Kaprekar numbers". Journal of Recreational Mathematics. 13: 81–82.
M. Charosh (1981–1982). "Some Applications of Casting Out 999...'s". Journal of Recreational Mathematics. 14: 111–118.
Iannucci, Douglas E. (2000). "The Kaprekar Numbers". Journal of Integer Sequences. 3: 00.1.2. Bibcode:2000JIntS...3...12I.