Base-dependent property of integers
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. الأعداد مسماة على اسم د. ر. كاپريكار .
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
التعريف والخصائص
Let
n
{\displaystyle n}
be a natural number. We define 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} }
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 .
For example, in base 10 , 45 is a 2-Kaprekar number, 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 .
التعريف حسب نظرية الفئات وقواسم الوحدة
We can define the set
K
(
N
)
{\displaystyle K(N)}
for a given integer
N
{\displaystyle N}
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 [1]
X
2
=
A
N
+
B
{\displaystyle X^{2}=AN+B}
, where
0
≤
B
<
N
{\displaystyle 0\leq B<N}
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[1] 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.
Proof
Let
X
1
=
b
p
−
1
2
=
b
−
1
2
∑
i
=
0
p
−
1
b
i
=
4
k
+
3
−
1
2
∑
i
=
0
2
n
+
1
−
1
b
i
=
(
2
k
+
1
)
∑
i
=
0
2
n
b
i
{\displaystyle {\begin{aligned}X_{1}&={\frac {b^{p}-1}{2}}\\&={\frac {b-1}{2}}\sum _{i=0}^{p-1}b^{i}\\&={\frac {4k+3-1}{2}}\sum _{i=0}^{2n+1-1}b^{i}\\&=(2k+1)\sum _{i=0}^{2n}b^{i}\end{aligned}}}
Then,
X
1
2
=
(
b
p
−
1
2
)
2
=
b
2
p
−
2
b
p
+
1
4
=
b
p
(
b
p
−
2
)
+
1
4
=
(
4
k
+
3
)
2
n
+
1
(
b
p
−
2
)
+
1
4
=
(
4
k
+
3
)
2
n
(
b
p
−
2
)
(
4
k
+
4
)
−
(
4
k
+
3
)
2
n
(
b
p
−
2
)
+
1
4
=
−
(
4
k
+
3
)
2
n
(
b
p
−
2
)
+
1
4
+
(
k
+
1
)
(
4
k
+
3
)
2
n
(
b
p
−
2
)
=
−
(
4
k
+
3
)
2
n
−
1
(
b
p
−
2
)
(
4
k
+
4
)
+
(
4
k
+
3
)
2
n
−
1
(
b
p
−
2
)
+
1
4
+
(
k
+
1
)
b
2
n
(
b
2
n
+
1
−
2
)
=
(
4
k
+
3
)
2
n
−
1
(
b
p
−
2
)
+
1
4
+
(
k
+
1
)
b
2
n
(
b
p
−
2
)
−
(
k
+
1
)
b
2
n
−
1
(
b
2
n
+
1
−
2
)
=
(
4
k
+
3
)
p
−
2
(
b
p
−
2
)
+
1
4
+
∑
i
=
p
−
2
p
−
1
(
−
1
)
i
(
k
+
1
)
b
i
(
b
p
−
2
)
=
(
4
k
+
3
)
p
−
2
(
b
p
−
2
)
+
1
4
+
(
b
p
−
2
)
(
k
+
1
)
∑
i
=
p
−
2
p
−
1
(
−
1
)
i
b
i
=
(
4
k
+
3
)
1
(
b
p
−
2
)
+
1
4
+
(
b
p
−
2
)
(
k
+
1
)
∑
i
=
1
p
−
1
(
−
1
)
i
b
i
=
−
(
b
p
−
2
)
+
1
4
+
(
b
p
−
2
)
(
k
+
1
)
∑
i
=
0
p
−
1
(
−
1
)
i
b
i
=
(
b
p
−
2
)
(
k
+
1
)
(
∑
i
=
0
2
n
(
−
1
)
i
b
i
)
+
−
b
2
n
+
1
+
3
4
=
(
b
p
−
2
)
(
k
+
1
)
(
∑
i
=
0
2
n
(
−
1
)
i
b
i
)
+
−
4
b
2
n
+
1
+
3
b
2
n
+
1
+
3
4
=
(
b
p
−
2
)
(
k
+
1
)
(
∑
i
=
0
2
n
(
−
1
)
i
b
i
)
−
b
p
+
3
b
2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^{p}-2)(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)+{\frac {-4b^{2n+1}+3b^{2n+1}+3}{4}}\\&=(b^{p}-2)(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)-b^{p}+{\frac {3b^{2n+1}+3}{4}}\\&=(b^{p}-2)(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)-b^{p}+{\frac {3(4k+3)^{p-2}+3}{4}}+3(k+1)\sum _{i=p-2}^{p-1}(-1)^{i}b^{i}\\&=(b^{p}-2)(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)-b^{p}+{\frac {3(4k+3)^{1}+3}{4}}+3(k+1)\sum _{i=1}^{p-1}(-1)^{i}b^{i}\\&=(b^{p}-2)(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)-b^{p}+{\frac {-3+3}{4}}+3(k+1)\sum _{i=0}^{p-1}(-1)^{i}b^{i}\\&=(b^{p}-2)(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)+3(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)-b^{p}\\&=(b^{p}-2+3)(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)-b^{p}\\&=(b^{p}+1)(k+1)\left(\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)-b^{p}\\&=(b^{p}+1)\left(-1+(k+1)\sum _{i=0}^{2n}(-1)^{i}b^{i}\right)+1\\&=(b^{p}+1)\left(k+(k+1)\sum _{i=1}^{2n}(-1)^{i}b^{i}\right)+1\\&=(b^{p}+1)\left(k+(k+1)\sum _{i=1}^{n}b^{2i}-b^{2i-1}\right)+1\\&=(b^{p}+1)\left(k+(k+1)\sum _{i=1}^{n}(b-1)b^{2i-1}\right)+1\\&=(b^{p}+1)\left(k+\sum _{i=1}^{n}((k+1)b-k-1)b^{2i-1}\right)+1\\&=(b^{p}+1)\left(k+\sum _{i=1}^{n}(kb+(4k+3)-k-1)b^{2i-1}\right)+1\\&=(b^{p}+1)\left(k+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)+1\\&=b^{p}\left(k+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)+\left(k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)\end{aligned}}}
The two numbers
α
{\displaystyle \alpha }
and
β
{\displaystyle \beta }
are
β
=
X
1
2
mod
b
p
=
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
{\displaystyle \beta =X_{1}^{2}{\bmod {b}}^{p}=k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}}
α
=
X
1
2
−
β
b
p
=
k
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
{\displaystyle \alpha ={\frac {X_{1}^{2}-\beta }{b^{p}}}=k+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}}
and their sum is
α
+
β
=
(
k
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
)
+
(
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
)
=
2
k
+
1
+
∑
i
=
1
n
(
(
2
k
)
b
+
2
(
3
k
+
2
)
)
b
2
i
−
1
=
2
k
+
1
+
∑
i
=
1
n
(
(
2
k
)
b
+
(
6
k
+
4
)
)
b
2
i
−
1
=
2
k
+
1
+
∑
i
=
1
n
(
(
2
k
)
b
+
(
4
k
+
3
)
)
b
2
i
−
1
+
(
2
k
+
1
)
b
2
i
−
1
=
2
k
+
1
+
∑
i
=
1
n
(
(
2
k
+
1
)
b
)
b
2
i
−
1
+
(
2
k
+
1
)
b
2
i
−
1
=
2
k
+
1
+
∑
i
=
1
n
(
2
k
+
1
)
b
2
i
+
(
2
k
+
1
)
b
2
i
−
1
=
2
k
+
1
+
∑
i
=
1
2
n
(
2
k
+
1
)
b
i
=
∑
i
=
0
2
n
(
2
k
+
1
)
b
i
=
(
2
k
+
1
)
∑
i
=
0
2
n
b
i
=
X
1
{\displaystyle {\begin{aligned}\alpha +\beta &=\left(k+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)+\left(k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)\\&=2k+1+\sum _{i=1}^{n}((2k)b+2(3k+2))b^{2i-1}\\&=2k+1+\sum _{i=1}^{n}((2k)b+(6k+4))b^{2i-1}\\&=2k+1+\sum _{i=1}^{n}((2k)b+(4k+3))b^{2i-1}+(2k+1)b^{2i-1}\\&=2k+1+\sum _{i=1}^{n}((2k+1)b)b^{2i-1}+(2k+1)b^{2i-1}\\&=2k+1+\sum _{i=1}^{n}(2k+1)b^{2i}+(2k+1)b^{2i-1}\\&=2k+1+\sum _{i=1}^{2n}(2k+1)b^{i}\\&=\sum _{i=0}^{2n}(2k+1)b^{i}\\&=(2k+1)\sum _{i=0}^{2n}b^{i}&=X_{1}\\\end{aligned}}}
Thus,
X
1
{\displaystyle X_{1}}
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}
.
Proof
Let
X
2
=
b
2
n
+
1
+
1
2
=
b
2
n
+
1
−
1
2
+
1
=
X
1
+
1
{\displaystyle {\begin{aligned}X_{2}&={\frac {b^{2n+1}+1}{2}}\\&={\frac {b^{2n+1}-1}{2}}+1\\&=X_{1}+1\end{aligned}}}
Then,
X
2
2
=
(
X
1
+
1
)
2
=
X
1
2
+
2
X
1
+
1
=
X
1
2
+
2
X
1
+
1
=
b
p
(
k
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
)
+
(
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
)
+
b
p
−
1
+
1
=
b
p
(
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
)
+
(
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
)
{\displaystyle {\begin{aligned}X_{2}^{2}&=(X_{1}+1)^{2}\\&=X_{1}^{2}+2X_{1}+1\\&=X_{1}^{2}+2X_{1}+1\\&=b^{p}\left(k+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)+\left(k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)+b^{p}-1+1\\&=b^{p}\left(k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)+\left(k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)\end{aligned}}}
The two numbers
α
{\displaystyle \alpha }
and
β
{\displaystyle \beta }
are
β
=
X
2
2
mod
b
p
=
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
{\displaystyle \beta =X_{2}^{2}{\bmod {b}}^{p}=k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}}
α
=
X
2
2
−
β
b
p
=
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
{\displaystyle \alpha ={\frac {X_{2}^{2}-\beta }{b^{p}}}=k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}}
and their sum is
α
+
β
=
(
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
)
+
(
k
+
1
+
∑
i
=
1
n
(
k
b
+
(
3
k
+
2
)
)
b
2
i
−
1
)
=
2
k
+
2
+
∑
i
=
1
n
(
(
2
k
)
b
+
2
(
3
k
+
2
)
)
b
2
i
−
1
=
2
k
+
2
+
∑
i
=
1
n
(
(
2
k
)
b
+
(
6
k
+
4
)
)
b
2
i
−
1
=
2
k
+
2
+
∑
i
=
1
n
(
(
2
k
)
b
+
(
4
k
+
3
)
)
b
2
i
−
1
+
(
2
k
+
1
)
b
2
i
−
1
=
2
k
+
2
+
∑
i
=
1
n
(
(
2
k
+
1
)
b
)
b
2
i
−
1
+
(
2
k
+
1
)
b
2
i
−
1
=
2
k
+
2
+
∑
i
=
1
n
(
2
k
+
1
)
b
2
i
+
(
2
k
+
1
)
b
2
i
−
1
=
2
k
+
2
+
∑
i
=
1
2
n
(
2
k
+
1
)
b
i
=
1
+
∑
i
=
0
2
n
(
2
k
+
1
)
b
i
=
1
+
(
2
k
+
1
)
∑
i
=
0
2
n
b
i
=
1
+
X
1
=
X
2
{\displaystyle {\begin{aligned}\alpha +\beta &=\left(k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)+\left(k+1+\sum _{i=1}^{n}(kb+(3k+2))b^{2i-1}\right)\\&=2k+2+\sum _{i=1}^{n}((2k)b+2(3k+2))b^{2i-1}\\&=2k+2+\sum _{i=1}^{n}((2k)b+(6k+4))b^{2i-1}\\&=2k+2+\sum _{i=1}^{n}((2k)b+(4k+3))b^{2i-1}+(2k+1)b^{2i-1}\\&=2k+2+\sum _{i=1}^{n}((2k+1)b)b^{2i-1}+(2k+1)b^{2i-1}\\&=2k+2+\sum _{i=1}^{n}(2k+1)b^{2i}+(2k+1)b^{2i-1}\\&=2k+2+\sum _{i=1}^{2n}(2k+1)b^{i}\\&=1+\sum _{i=0}^{2n}(2k+1)b^{i}\\&=1+(2k+1)\sum _{i=0}^{2n}b^{i}\\&=1+X_{1}\\&=X_{2}\end{aligned}}}
Thus,
X
2
{\displaystyle X_{2}}
is a Kaprekar number.
b = m 2 k + 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 = m 2 k + 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 = m 2 k + m 2 − 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 = m 2 k + m 2 − 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}
.
Base
b
{\displaystyle b}
Power
p
{\displaystyle p}
Nontrivial Kaprekar numbers
n
≠
0
{\displaystyle n\neq 0}
,
n
≠
1
{\displaystyle n\neq 1}
Cycles
2
1
10
∅
{\displaystyle \varnothing }
3
1
2, 10
∅
{\displaystyle \varnothing }
4
1
3, 10
∅
{\displaystyle \varnothing }
5
1
4, 5, 10
∅
{\displaystyle \varnothing }
6
1
5, 6, 10
∅
{\displaystyle \varnothing }
7
1
3, 4, 6, 10
∅
{\displaystyle \varnothing }
8
1
7, 10
2 → 4 → 2
9
1
8, 10
∅
{\displaystyle \varnothing }
10
1
9, 10
∅
{\displaystyle \varnothing }
11
1
5, 6, A, 10
∅
{\displaystyle \varnothing }
12
1
B, 10
∅
{\displaystyle \varnothing }
13
1
4, 9, C, 10
∅
{\displaystyle \varnothing }
14
1
D, 10
∅
{\displaystyle \varnothing }
15
1
7, 8, E, 10
2 → 4 → 2
9 → B → 9
16
1
6, A, F, 10
∅
{\displaystyle \varnothing }
2
2
11
∅
{\displaystyle \varnothing }
3
2
22, 100
∅
{\displaystyle \varnothing }
4
2
12, 22, 33, 100
∅
{\displaystyle \varnothing }
5
2
14, 31, 44, 100
∅
{\displaystyle \varnothing }
6
2
23, 33, 55, 100
15 → 24 → 15
41 → 50 → 41
7
2
22, 45, 66, 100
∅
{\displaystyle \varnothing }
8
2
34, 44, 77, 100
4 → 20 → 4
11 → 22 → 11
45 → 56 → 45
2
3
111, 1000
10 → 100 → 10
3
3
111, 112, 222, 1000
10 → 100 → 10
2
4
110, 1010, 1111, 10000
∅
{\displaystyle \varnothing }
3
4
121, 2102, 2222, 10000
∅
{\displaystyle \varnothing }
2
5
11111, 100000
10 → 100 → 10000 → 1000 → 10
111 → 10010 → 1110 → 1010 → 111
3
5
11111, 22222, 100000
10 → 100 → 10000 → 1000 → 10
2
6
11100, 100100, 111111, 1000000
100 → 10000 → 100
1001 → 10010 → 1001
100101 → 101110 → 100101
3
6
10220, 20021, 101010, 121220, 202202, 212010, 222222, 1000000
100 → 10000 → 100
122012 → 201212 → 122012
2
7
1111111, 10000000
10 → 100 → 10000 → 10
1000 → 1000000 → 100000 → 1000
100110 → 101111 → 110010 → 1010111 → 1001100 → 111101 → 100110
3
7
1111111, 1111112, 2222222, 10000000
10 → 100 → 10000 → 10
1000 → 1000000 → 100000 → 1000
1111121 → 1111211 → 1121111 → 1111121
2
8
1010101, 1111000, 10001000, 10101011, 11001101, 11111111, 100000000
∅
{\displaystyle \varnothing }
3
8
2012021, 10121020, 12101210, 21121001, 20210202, 22222222, 100000000
∅
{\displaystyle \varnothing }
2
9
10010011, 101101101, 111111111, 1000000000
10 → 100 → 10000 → 100000000 → 10000000 → 100000 → 10
1000 → 1000000 → 1000
10011010 → 11010010 → 10011010
امتداد للأعداد الصحيحة السالبة
Kaprekar numbers can be extended to the negative integers by use of a signed-digit representation to represent each integer.
تمرين في البرمجة
The example below implements the Kaprekar function described in the definition above to search for Kaprekar numbers and cycles in Python .
def kaprekarf ( x : int , p : int , b : int ) -> int :
beta = pow ( x , 2 ) % pow ( b , p )
alpha = ( pow ( x , 2 ) - beta ) // pow ( b , p )
y = alpha + beta
return y
def kaprekarf_cycle ( x : int , p : int , b : int ) -> List [ int ]:
seen = []
while x < pow ( b , p ) and x not in seen :
seen . append ( x )
x = kaprekarf ( x , p , b )
if x > pow ( b , p ):
return []
cycle = []
while x not in cycle :
cycle . append ( x )
x = kaprekarf ( x , p , b )
return cycle
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
انظر أيضاً
الهامش
المراجع
أعداد متعددات الحدود الأخرى
Possessing a specific set of other numbers
يمكن التعبير عنها بجموع معينة