Kaprekar number: Difference between revisions
No edit summary Tags: Manual revert Reverted |
Registreernu (talk | contribs) Tags: Mobile edit Mobile web edit |
||
(32 intermediate revisions by 21 users not shown) | |||
Line 1: | Line 1: | ||
{{Short description|Base-dependent property of integers}} |
|||
{{distinguish|Kaprekar's constant}} |
{{distinguish|Kaprekar's constant}} |
||
In [[mathematics]], a [[natural number]] in a given [[number base]] is a <math>p</math>-'''Kaprekar number''' if the representation of its square in that base can be split into two parts, where the second part has <math>p</math> digits, that add up to the original number. The numbers are named after [[D. R. Kaprekar]]. |
In [[mathematics]], a [[natural number]] in a given [[number base]] is a <math>p</math>-'''Kaprekar number''' if the representation of its square in that base can be split into two parts, where the second part has <math>p</math> 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 == |
== Definition and properties == |
||
Let <math>n</math> be a natural number. |
Let <math>n</math> be a natural number. Then the '''Kaprekar function''' for base <math>b > 1</math> and power <math>p > 0</math> <math>F_{p, b} : \mathbb{N} \rightarrow \mathbb{N}</math> is defined to be the following: |
||
:<math>F_{p, b}(n) = \alpha + \beta</math>, |
:<math>F_{p, b}(n) = \alpha + \beta</math>, |
||
where <math>\beta = n^2 \bmod b^p</math> and |
where <math>\beta = n^2 \bmod b^p</math> and |
||
Line 10: | Line 11: | ||
A natural number <math>n</math> is a <math>p</math>-'''Kaprekar number''' if it is a [[Fixed point (mathematics)|fixed point]] for <math>F_{p, b}</math>, which occurs if <math>F_{p, b}(n) = n</math>. <math>0</math> and <math>1</math> are '''trivial Kaprekar numbers''' for all <math>b</math> and <math>p</math>, all other Kaprekar numbers are '''nontrivial Kaprekar numbers'''. |
A natural number <math>n</math> is a <math>p</math>-'''Kaprekar number''' if it is a [[Fixed point (mathematics)|fixed point]] for <math>F_{p, b}</math>, which occurs if <math>F_{p, b}(n) = n</math>. <math>0</math> and <math>1</math> are '''trivial Kaprekar numbers''' for all <math>b</math> and <math>p</math>, all other Kaprekar numbers are '''nontrivial Kaprekar numbers'''. |
||
The earlier example of 45 satisfies this definition with <math>b = 10</math> and <math>p = 2</math>, because |
|||
: <math>\beta = n^2 \bmod b^p = 45^2 \bmod 10^2 = 25</math> |
: <math>\beta = n^2 \bmod b^p = 45^2 \bmod 10^2 = 25</math> |
||
: <math>\alpha = \frac{n^2 - \beta}{b^p} = \frac{45^2 - 25}{10^2} = 20</math> |
: <math>\alpha = \frac{n^2 - \beta}{b^p} = \frac{45^2 - 25}{10^2} = 20</math> |
||
Line 21: | Line 22: | ||
There are only a finite number of <math>p</math>-Kaprekar numbers and cycles for a given base <math>b</math>, because if <math>n = b^p + m</math>, where <math>m > 0</math> then |
There are only a finite number of <math>p</math>-Kaprekar numbers and cycles for a given base <math>b</math>, because if <math>n = b^p + m</math>, where <math>m > 0</math> then |
||
<math> |
: <math> |
||
\begin{align} |
\begin{align} |
||
n^2 & = (b^p + m)^2 \\ |
n^2 & = (b^p + m)^2 \\ |
||
Line 33: | Line 34: | ||
If <math>d</math> is any divisor of <math>p</math>, then <math>n</math> is also a <math>p</math>-Kaprekar number for base <math>b^p</math>. |
If <math>d</math> is any divisor of <math>p</math>, then <math>n</math> is also a <math>p</math>-Kaprekar number for base <math>b^p</math>. |
||
In base <math>b = 2</math>, all even [[perfect number]]s are Kaprekar numbers. |
In base <math>b = 2</math>, all even [[perfect number]]s are Kaprekar numbers. More generally, any numbers of the form <math>2^n (2^{n + 1} - 1)</math> or <math>2^n (2^{n + 1} + 1)</math> for natural number <math>n</math> are Kaprekar numbers in [[base 2]]. |
||
===Set- |
===Set-theoretic definition and unitary divisors=== |
||
The set <math>K(N)</math> for a given integer <math>N</math> can be defined as the set of integers <math>X</math> for which there exist natural numbers <math>A</math> and <math>B</math> satisfying the [[Diophantine equation]]<ref name=iannucci>Iannucci ([[#CITEREFIannucci2000|2000]])</ref> |
|||
: <math>X^2 = AN + B</math>, where <math>0 \leq B < N</math> |
: <math>X^2 = AN + B</math>, where <math>0 \leq B < N</math> |
||
: <math>X = A + B</math> |
: <math>X = A + B</math> |
||
An <math>n</math>-Kaprekar number for base <math>b</math> is then one which lies in the set <math>K(b^n)</math>. |
An <math>n</math>-Kaprekar number for base <math>b</math> is then one which lies in the set <math>K(b^n)</math>. |
||
It was shown in 2000<ref name=iannucci/> that there is a [[bijection]] between the [[unitary divisor]]s of <math>N - 1</math> and the set <math>K(N)</math> defined above. |
It was shown in 2000<ref name=iannucci/> that there is a [[bijection]] between the [[unitary divisor]]s of <math>N - 1</math> and the set <math>K(N)</math> defined above. Let <math>\operatorname{Inv}(a, c)</math> denote the [[Modular multiplicative inverse|multiplicative inverse]] of <math>a</math> modulo <math>c</math>, namely the least positive integer <math>m</math> such that <math>am = 1 \bmod c</math>, and for each unitary divisor <math>d</math> of <math>N - 1</math> let <math>e = \frac{N - 1}{d}</math> and <math>\zeta(d) = d\ \text{Inv}(d, e)</math>. Then the function <math>\zeta</math> is a bijection from the set of unitary divisors of <math>N - 1</math> onto the set <math>K(N)</math>. In particular, a number <math>X</math> is in the set <math>K(N)</math> if and only if <math>X = d\ \text{Inv}(d, e)</math> for some unitary divisor <math>d</math> of <math>N - 1</math>. |
||
The numbers |
The numbers in <math>K(N)</math> occur in complementary pairs, <math>X</math> and <math>N - X</math>. If <math>d</math> is a unitary divisor of <math>N - 1</math> then so is <math>e = \frac{N - 1}{d}</math>, and if <math>X = d\operatorname{Inv}(d, e)</math> then <math>N - X = e\operatorname{Inv}(e, d)</math>. |
||
==Kaprekar numbers for <math>F_{p, b}</math>== |
==Kaprekar numbers for <math>F_{p, b}</math>== |
||
Line 57: | Line 58: | ||
& = \frac{b - 1}{2} \sum_{i = 0}^{p - 1} b^i \\ |
& = \frac{b - 1}{2} \sum_{i = 0}^{p - 1} b^i \\ |
||
& = \frac{4k + 3 - 1}{2} \sum_{i = 0}^{2n + 1 - 1} b^i \\ |
& = \frac{4k + 3 - 1}{2} \sum_{i = 0}^{2n + 1 - 1} b^i \\ |
||
& = (2k + 1) \sum_{i = 0}^{2n} b^i |
& = (2k + 1) \sum_{i = 0}^{2n} b^i |
||
\end{align} |
\end{align} |
||
</math> |
</math> |
||
Line 93: | Line 94: | ||
& = (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 + (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 + 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) |
& = 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{align} |
\end{align} |
||
</math> |
</math> |
||
Line 113: | Line 114: | ||
& = 2k + 1 + \sum_{i = 1}^{2n} (2k + 1)b^{i} \\ |
& = 2k + 1 + \sum_{i = 1}^{2n} (2k + 1)b^{i} \\ |
||
& = \sum_{i = 0}^{2n} (2k + 1)b^{i} \\ |
& = \sum_{i = 0}^{2n} (2k + 1)b^{i} \\ |
||
& = (2k + 1) \sum_{i = 0}^{2n} b^ |
& = (2k + 1) \sum_{i = 0}^{2n} b^i |
||
& = X_1 \\ |
& = X_1 \\ |
||
\end{align} |
\end{align} |
||
Line 129: | Line 130: | ||
X_2 & = \frac{b^{2n + 1} + 1}{2} \\ |
X_2 & = \frac{b^{2n + 1} + 1}{2} \\ |
||
& = \frac{b^{2n + 1} - 1}{2} + 1 \\ |
& = \frac{b^{2n + 1} - 1}{2} + 1 \\ |
||
& = X_1 + 1 |
& = X_1 + 1 |
||
\end{align} |
\end{align} |
||
</math> |
</math> |
||
Line 141: | Line 142: | ||
& = X_1^2 + 2 X_1 + 1 \\ |
& = X_1^2 + 2 X_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 + \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) |
& = 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{align} |
\end{align} |
||
</math> |
</math> |
||
Line 162: | Line 163: | ||
& = 1 + (2k + 1) \sum_{i = 0}^{2n} b^{i} \\ |
& = 1 + (2k + 1) \sum_{i = 0}^{2n} b^{i} \\ |
||
& = 1 + X_1 \\ |
& = 1 + X_1 \\ |
||
& = X_2 |
& = X_2 |
||
\end{align} |
\end{align} |
||
</math> |
</math> |
||
Line 174: | Line 175: | ||
* <math>X_2 = \frac{b^p + m - 1}{m} = X_1 + 1</math> is a Kaprekar number. |
* <math>X_2 = \frac{b^p + m - 1}{m} = X_1 + 1</math> is a Kaprekar number. |
||
===''b'' = ''m''<sup>2</sup>''k'' + ''m'' + 1 and ''p'' = ''mn'' + ''m'' |
===''b'' = ''m''<sup>2</sup>''k'' + ''m'' + 1 and ''p'' = ''mn'' + ''m'' − 1=== |
||
Let <math>m</math>, <math>k</math>, and <math>n</math> be natural numbers, the number base <math>b = m^2k + m + 1</math>, and the power <math>p = mn + m - 1</math>. Then: |
Let <math>m</math>, <math>k</math>, and <math>n</math> be natural numbers, the number base <math>b = m^2k + m + 1</math>, and the power <math>p = mn + m - 1</math>. Then: |
||
* <math>X_1 = \frac{m(b^p - 1)}{4} = (m - 1)(mk + 1) \sum_{i = 0}^{p - 1} b^i</math> is a Kaprekar number. |
* <math>X_1 = \frac{m(b^p - 1)}{4} = (m - 1)(mk + 1) \sum_{i = 0}^{p - 1} b^i</math> is a Kaprekar number. |
||
* <math>X_2 = \frac{mb^p + 1}{4} = X_3 + 1</math> is a Kaprekar number. |
* <math>X_2 = \frac{mb^p + 1}{4} = X_3 + 1</math> is a Kaprekar number. |
||
===''b'' = ''m''<sup>2</sup>''k'' + ''m''<sup>2</sup> |
===''b'' = ''m''<sup>2</sup>''k'' + ''m''<sup>2</sup> − ''m'' + 1 and ''p'' = ''mn'' + 1=== |
||
Let <math>m</math>, <math>k</math>, and <math>n</math> be natural numbers, the number base <math>b = m^2k + m^2 - m + 1</math>, and the power <math>p = mn + m - 1</math>. Then: |
Let <math>m</math>, <math>k</math>, and <math>n</math> be natural numbers, the number base <math>b = m^2k + m^2 - m + 1</math>, and the power <math>p = mn + m - 1</math>. Then: |
||
* <math>X_1 = \frac{(m - 1)(b^p - 1)}{m} = (m - 1)(mk + 1) \sum_{i = 0}^{p - 1} b^i</math> is a Kaprekar number. |
* <math>X_1 = \frac{(m - 1)(b^p - 1)}{m} = (m - 1)(mk + 1) \sum_{i = 0}^{p - 1} b^i</math> is a Kaprekar number. |
||
* <math>X_2 = \frac{(m - 1)b^p + 1}{m} = X_1 + 1</math> is a Kaprekar number. |
* <math>X_2 = \frac{(m - 1)b^p + 1}{m} = X_1 + 1</math> is a Kaprekar number. |
||
===''b'' = ''m''<sup>2</sup>''k'' + ''m''<sup>2</sup> |
===''b'' = ''m''<sup>2</sup>''k'' + ''m''<sup>2</sup> − ''m'' + 1 and ''p'' = ''mn'' + ''m'' − 1=== |
||
Let <math>m</math>, <math>k</math>, and <math>n</math> be natural numbers, the number base <math>b = m^2k + m^2 - m + 1</math>, and the power <math>p = mn + m - 1</math>. Then: |
Let <math>m</math>, <math>k</math>, and <math>n</math> be natural numbers, the number base <math>b = m^2k + m^2 - m + 1</math>, and the power <math>p = mn + m - 1</math>. Then: |
||
* <math>X_1 = \frac{b^p - 1}{m} = (mk + 1) \sum_{i = 0}^{p - 1} b^i</math> is a Kaprekar number. |
* <math>X_1 = \frac{b^p - 1}{m} = (mk + 1) \sum_{i = 0}^{p - 1} b^i</math> is a Kaprekar number. |
||
Line 197: | Line 198: | ||
! Cycles |
! Cycles |
||
|--- |
|--- |
||
| [[base-2|2]] || 1 || 10 || |
| [[base-2|2]] || 1 || 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| [[base-3|3]] || 1 || 2, 10 || |
| [[base-3|3]] || 1 || 2, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| [[base-4|4]] || 1 || 3, 10 || |
| [[base-4|4]] || 1 || 3, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| [[base-5|5]] || 1 || 4, 5, 10 || |
| [[base-5|5]] || 1 || 4, 5, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| [[base-6|6]] || 1 || 5, 6, 10 || |
| [[base-6|6]] || 1 || 5, 6, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 7 || 1 || 3, 4, 6, 10 || |
| 7 || 1 || 3, 4, 6, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| [[base-8|8]] || 1 || 7, 10 || 2 → 4 → 2 |
| [[base-8|8]] || 1 || 7, 10 || 2 → 4 → 2 |
||
|--- |
|--- |
||
| [[base-9|9]] || 1 || 8, 10 || |
| [[base-9|9]] || 1 || 8, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| [[base-10|10]] || 1 || 9, 10 || |
| [[base-10|10]] || 1 || 9, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 11 || 1 || 5, 6, A, 10 || |
| 11 || 1 || 5, 6, A, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| [[base-12|12]] || 1 || B, 10 || |
| [[base-12|12]] || 1 || B, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 13 || 1 || 4, 9, C, 10 || |
| 13 || 1 || 4, 9, C, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 14 || 1 || D, 10 || |
| 14 || 1 || D, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 15 || 1 || 7, 8, E, 10 || |
| 15 || 1 || 7, 8, E, 10 || |
||
Line 228: | Line 229: | ||
9 → B → 9 |
9 → B → 9 |
||
|--- |
|--- |
||
| [[base-16|16]] || 1 || 6, A, F, 10 || |
| [[base-16|16]] || 1 || 6, A, F, 10 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 2 || 2 || 11 || |
| 2 || 2 || 11 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 3 || 2 || 22, 100 || |
| 3 || 2 || 22, 100 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 4 || 2 || 12, 22, 33, 100 || |
| 4 || 2 || 12, 22, 33, 100 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 5 || 2 || 14, 31, 44, 100 || |
| 5 || 2 || 14, 31, 44, 100 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 6 || 2 || 23, 33, 55, 100 || |
| 6 || 2 || 23, 33, 55, 100 || |
||
Line 243: | Line 244: | ||
41 → 50 → 41 |
41 → 50 → 41 |
||
|--- |
|--- |
||
| 7 || 2 || 22, 45, 66, 100 || |
| 7 || 2 || 22, 45, 66, 100 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 8 || 2 || 34, 44, 77, 100 || |
| 8 || 2 || 34, 44, 77, 100 || |
||
Line 256: | Line 257: | ||
| 3 || 3 || 111, 112, 222, 1000 || 10 → 100 → 10 |
| 3 || 3 || 111, 112, 222, 1000 || 10 → 100 → 10 |
||
|--- |
|--- |
||
| 2 || 4 || 110, 1010, 1111, 10000 || |
| 2 || 4 || 110, 1010, 1111, 10000 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 3 || 4 || 121, 2102, 2222, 10000 || |
| 3 || 4 || 121, 2102, 2222, 10000 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 2 || 5 || 11111, 100000 || |
| 2 || 5 || 11111, 100000 || |
||
Line 293: | Line 294: | ||
1111121 → 1111211 → 1121111 → 1111121 |
1111121 → 1111211 → 1121111 → 1111121 |
||
|--- |
|--- |
||
| 2 || 8 || 1010101, 1111000, 10001000, 10101011, 11001101, 11111111, 100000000 || |
| 2 || 8 || 1010101, 1111000, 10001000, 10101011, 11001101, 11111111, 100000000 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 3 || 8 || 2012021, 10121020, 12101210, 21121001, 20210202, 22222222, 100000000 || |
| 3 || 8 || 2012021, 10121020, 12101210, 21121001, 20210202, 22222222, 100000000 || <math>\varnothing</math> |
||
|--- |
|--- |
||
| 2 || 9 || 10010011, 101101101, 111111111, 1000000000 || |
| 2 || 9 || 10010011, 101101101, 111111111, 1000000000 || |
||
Line 307: | Line 308: | ||
==Extension to negative integers== |
==Extension to negative integers== |
||
Kaprekar numbers can be extended to the negative integers by use of a [[signed-digit representation]] to represent each integer. |
Kaprekar numbers can be extended to the negative integers by use of a [[signed-digit representation]] to represent each integer. |
||
==Programming exercise== |
|||
The example below implements the Kaprekar function described in the definition above [[Cycle detection|to search for Kaprekar numbers and cycles]] in [[Python (programming language)|Python]]. |
|||
<syntaxhighlight lang="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 |
|||
</syntaxhighlight> |
|||
==See also== |
==See also== |
||
Line 350: | Line 328: | ||
* {{cite journal |author=D. R. Kaprekar |title=On Kaprekar numbers |journal=[[Journal of Recreational Mathematics]] |volume=13 |year=1980–1981 |pages=81–82}} |
* {{cite journal |author=D. R. Kaprekar |title=On Kaprekar numbers |journal=[[Journal of Recreational Mathematics]] |volume=13 |year=1980–1981 |pages=81–82}} |
||
* {{cite journal |author=M. Charosh |title=Some Applications of Casting Out 999...'s |journal=[[Journal of Recreational Mathematics]] |volume=14 |year=1981–1982 |pages=111–118}} |
* {{cite journal |author=M. Charosh |title=Some Applications of Casting Out 999...'s |journal=[[Journal of Recreational Mathematics]] |volume=14 |year=1981–1982 |pages=111–118}} |
||
* {{cite journal |first=Douglas E.| last=Iannucci |title=The Kaprekar Numbers |journal=[[Journal of Integer Sequences]] |volume=3 |year=2000 |url=https://cs.uwaterloo.ca/journals/JIS/VOL3/iann2a.html|pages=00.1.2}} |
* {{cite journal |first=Douglas E.| last=Iannucci |title=The Kaprekar Numbers |journal=[[Journal of Integer Sequences]] |volume=3 |year=2000 |url=https://cs.uwaterloo.ca/journals/JIS/VOL3/iann2a.html|pages=00.1.2| bibcode=2000JIntS...3...12I }} |
||
{{Classes of natural numbers}} |
{{Classes of natural numbers}} |
||
Line 357: | Line 335: | ||
[[Category:Base-dependent integer sequences]] |
[[Category:Base-dependent integer sequences]] |
||
[[Category:Diophantine equations]] |
[[Category:Diophantine equations]] |
||
[[Category:Eponymous numbers in mathematics]] |
|||
[[Category:Number theory]] |
[[Category:Number theory]] |
Latest revision as of 18:03, 4 May 2024
In mathematics, a natural number in a given number base is a -Kaprekar number if the representation of its square in that base can be split into two parts, where the second part has 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
[edit]Let be a natural number. Then the Kaprekar function for base and power is defined to be the following:
- ,
where and
A natural number is a -Kaprekar number if it is a fixed point for , which occurs if . and are trivial Kaprekar numbers for all and , all other Kaprekar numbers are nontrivial Kaprekar numbers.
The earlier example of 45 satisfies this definition with and , because
A natural number is a sociable Kaprekar number if it is a periodic point for , where for a positive integer (where is the th iterate of ), and forms a cycle of period . A Kaprekar number is a sociable Kaprekar number with , and a amicable Kaprekar number is a sociable Kaprekar number with .
The number of iterations needed for to reach a fixed point is the Kaprekar function's persistence of , and undefined if it never reaches a fixed point.
There are only a finite number of -Kaprekar numbers and cycles for a given base , because if , where then
and , , and . Only when do Kaprekar numbers and cycles exist.
If is any divisor of , then is also a -Kaprekar number for base .
In base , all even perfect numbers are Kaprekar numbers. More generally, any numbers of the form or for natural number are Kaprekar numbers in base 2.
Set-theoretic definition and unitary divisors
[edit]The set for a given integer can be defined as the set of integers for which there exist natural numbers and satisfying the Diophantine equation[1]
- , where
An -Kaprekar number for base is then one which lies in the set .
It was shown in 2000[1] that there is a bijection between the unitary divisors of and the set defined above. Let denote the multiplicative inverse of modulo , namely the least positive integer such that , and for each unitary divisor of let and . Then the function is a bijection from the set of unitary divisors of onto the set . In particular, a number is in the set if and only if for some unitary divisor of .
The numbers in occur in complementary pairs, and . If is a unitary divisor of then so is , and if then .
Kaprekar numbers for
[edit]b = 4k + 3 and p = 2n + 1
[edit]Let and be natural numbers, the number base , and . Then:
- is a Kaprekar number.
Let
Then,
The two numbers and are
and their sum is
Thus, is a Kaprekar number.
- is a Kaprekar number for all natural numbers .
Let
Then,
The two numbers and are
and their sum is
Thus, is a Kaprekar number.
b = m2k + m + 1 and p = mn + 1
[edit]Let , , and be natural numbers, the number base , and the power . Then:
- is a Kaprekar number.
- is a Kaprekar number.
b = m2k + m + 1 and p = mn + m − 1
[edit]Let , , and be natural numbers, the number base , and the power . Then:
- is a Kaprekar number.
- is a Kaprekar number.
b = m2k + m2 − m + 1 and p = mn + 1
[edit]Let , , and be natural numbers, the number base , and the power . Then:
- is a Kaprekar number.
- is a Kaprekar number.
b = m2k + m2 − m + 1 and p = mn + m − 1
[edit]Let , , and be natural numbers, the number base , and the power . Then:
- is a Kaprekar number.
- is a Kaprekar number.
Kaprekar numbers and cycles of for specific ,
[edit]All numbers are in base .
Base | Power | Nontrivial Kaprekar numbers , | Cycles |
---|---|---|---|
2 | 1 | 10 | |
3 | 1 | 2, 10 | |
4 | 1 | 3, 10 | |
5 | 1 | 4, 5, 10 | |
6 | 1 | 5, 6, 10 | |
7 | 1 | 3, 4, 6, 10 | |
8 | 1 | 7, 10 | 2 → 4 → 2 |
9 | 1 | 8, 10 | |
10 | 1 | 9, 10 | |
11 | 1 | 5, 6, A, 10 | |
12 | 1 | B, 10 | |
13 | 1 | 4, 9, C, 10 | |
14 | 1 | D, 10 | |
15 | 1 | 7, 8, E, 10 |
2 → 4 → 2 9 → B → 9 |
16 | 1 | 6, A, F, 10 | |
2 | 2 | 11 | |
3 | 2 | 22, 100 | |
4 | 2 | 12, 22, 33, 100 | |
5 | 2 | 14, 31, 44, 100 | |
6 | 2 | 23, 33, 55, 100 |
15 → 24 → 15 41 → 50 → 41 |
7 | 2 | 22, 45, 66, 100 | |
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 | |
3 | 4 | 121, 2102, 2222, 10000 | |
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 | |
3 | 8 | 2012021, 10121020, 12101210, 21121001, 20210202, 22222222, 100000000 | |
2 | 9 | 10010011, 101101101, 111111111, 1000000000 |
10 → 100 → 10000 → 100000000 → 10000000 → 100000 → 10 1000 → 1000000 → 1000 10011010 → 11010010 → 10011010 |
Extension to negative integers
[edit]Kaprekar numbers can be extended to the negative integers by use of a signed-digit representation to represent each integer.
See also
[edit]- 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
[edit]References
[edit]- 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.