HOME

TheInfoList



OR:

In
mathematics Mathematics is an area of knowledge that includes the topics of numbers, formulas and related structures, shapes and the spaces in which they are contained, and quantities and their changes. These topics are represented in modern mathematics ...
, a
natural number In mathematics, the natural numbers are those numbers used for counting (as in "there are ''six'' coins on the table") and ordering (as in "this is the ''third'' largest city in the country"). Numbers used for counting are called ''Cardinal n ...
in a given
number base In a positional numeral system, the radix or base is the number of unique digits, including the digit zero, used to represent numbers. For example, for the decimal/denary system (the most common system in use today) the radix (base number) is t ...
is a p-Kaprekar number if the representation of its square in that base can be split into two parts, where the second part has p digits, that add up to the original number. The numbers are named after D. R. Kaprekar.


Definition and properties

Let n be a natural number. We define the Kaprekar function for base b > 1 and power p > 0 F_ : \mathbb \rightarrow \mathbb to be the following: :F_(n) = \alpha + \beta, where \beta = n^2 \bmod b^p and :\alpha = \frac A natural number n is a p-Kaprekar number if it is a fixed point for F_, which occurs if F_(n) = n. 0 and 1 are trivial Kaprekar numbers for all b and p, all other Kaprekar numbers are nontrivial Kaprekar numbers. For example, in
base 10 The decimal numeral system (also called the base-ten positional numeral system and denary or decanary) is the standard system for denoting integer and non-integer numbers. It is the extension to non-integer numbers of the Hindu–Arabic numer ...
, 45 is a 2-Kaprekar number, because : \beta = n^2 \bmod b^p = 45^2 \bmod 10^2 = 25 : \alpha = \frac = \frac = 20 : F_(45) = \alpha + \beta = 20 + 25 = 45 A natural number n is a sociable Kaprekar number if it is a
periodic point In mathematics, in the study of iterated functions and dynamical systems, a periodic point of a function is a point which the system returns to after a certain number of function iterations or a certain amount of time. Iterated functions Given a ...
for F_, where F_^k(n) = n for a positive
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign (−1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the language ...
k (where F_^k is the kth
iterate Iteration is the repetition of a process in order to generate a (possibly unbounded) sequence of outcomes. Each repetition of the process is a single iteration, and the outcome of each iteration is then the starting point of the next iteration. ...
of F_), and forms a cycle of period k. A Kaprekar number is a sociable Kaprekar number with k = 1, and a amicable Kaprekar number is a sociable Kaprekar number with k = 2. The number of iterations i needed for F_^(n) to reach a fixed point is the Kaprekar function's persistence of n, and undefined if it never reaches a fixed point. There are only a finite number of p-Kaprekar numbers and cycles for a given base b, because if n = b^p + m, where m > 0 then : \begin n^2 & = (b^p + m)^2 \\ & = b^ + 2mb^p + m^2 \\ & = (b^p + 2m)b^p + m^2 \\ \end and \beta = m^2, \alpha = b^p + 2m, and F_(n) = b^p + 2m + m^2 = n + (m^2 + m) > n. Only when n \leq b^p do Kaprekar numbers and cycles exist. If d is any divisor of p, then n is also a p-Kaprekar number for base b^p. In base b = 2, all even
perfect number In number theory, a perfect number is a positive integer that is equal to the sum of its positive divisors, excluding the number itself. For instance, 6 has divisors 1, 2 and 3 (excluding itself), and 1 + 2 + 3 = 6, so 6 is a perfect number. T ...
s are Kaprekar numbers. More generally, any numbers of the form 2^n (2^ - 1) or 2^n (2^ + 1) for natural number n are Kaprekar numbers in base 2.


Set-theoric definition and unitary divisors

We can define the set K(N) for a given integer N as the set of integers X for which there exist natural numbers A and B satisfying the Diophantine equationIannucci (
2000 File:2000 Events Collage.png, From left, clockwise: Protests against Bush v. Gore after the 2000 United States presidential election; Heads of state meet for the Millennium Summit; The International Space Station in its infant form as seen from ...
)
: X^2 = AN + B, where 0 \leq B < N : X = A + B An n-Kaprekar number for base b is then one which lies in the set K(b^n). It was shown in 2000 that there is a bijection between the
unitary divisor In mathematics, a natural number ''a'' is a unitary divisor (or Hall divisor) of a number ''b'' if ''a'' is a divisor of ''b'' and if ''a'' and \frac are coprime, having no common factor other than 1. Thus, 5 is a unitary divisor of 60, because 5 an ...
s of N - 1 and the set K(N) defined above. Let \operatorname(a, c) denote the
multiplicative inverse In mathematics, a multiplicative inverse or reciprocal for a number ''x'', denoted by 1/''x'' or ''x''−1, is a number which when Multiplication, multiplied by ''x'' yields the multiplicative identity, 1. The multiplicative inverse of a rat ...
of a modulo c, namely the least positive integer m such that am = 1 \bmod c, and for each unitary divisor d of N - 1 let e = \frac and \zeta(d) = d\ \text(d, e). Then the function \zeta is a bijection from the set of unitary divisors of N - 1 onto the set K(N). In particular, a number X is in the set K(N) if and only if X = d\ \text(d, e) for some unitary divisor d of N - 1. The numbers in K(N) occur in complementary pairs, X and N - X. If d is a unitary divisor of N - 1 then so is e = \frac, and if X = d\operatorname(d, e) then N - X = e\operatorname(e, d).


Kaprekar numbers for F_


''b'' = 4''k'' + 3 and ''p'' = 2''n'' + 1

Let k and n be natural numbers, the number base b = 4k + 3 = 2(2k + 1) + 1, and p = 2n + 1. Then: * X_1 = \frac = (2k + 1) \sum_^ b^i is a Kaprekar number. * X_2 = \frac = X_1 + 1 is a Kaprekar number for all natural numbers n.


''b'' = ''m''2''k'' + ''m'' + 1 and ''p'' = ''mn'' + 1

Let m, k, and n be natural numbers, the number base b = m^2k + m + 1, and the power p = mn + 1. Then: * X_1 = \frac = (mk + 1) \sum_^ b^i is a Kaprekar number. * X_2 = \frac = X_1 + 1 is a Kaprekar number.


''b'' = ''m''2''k'' + ''m'' + 1 and ''p'' = ''mn'' + ''m'' − 1

Let m, k, and n be natural numbers, the number base b = m^2k + m + 1, and the power p = mn + m - 1. Then: * X_1 = \frac = (m - 1)(mk + 1) \sum_^ b^i is a Kaprekar number. * X_2 = \frac = X_3 + 1 is a Kaprekar number.


''b'' = ''m''2''k'' + ''m''2 − ''m'' + 1 and ''p'' = ''mn'' + 1

Let m, k, and n be natural numbers, the number base b = m^2k + m^2 - m + 1, and the power p = mn + m - 1. Then: * X_1 = \frac = (m - 1)(mk + 1) \sum_^ b^i is a Kaprekar number. * X_2 = \frac = X_1 + 1 is a Kaprekar number.


''b'' = ''m''2''k'' + ''m''2 − ''m'' + 1 and ''p'' = ''mn'' + ''m'' − 1

Let m, k, and n be natural numbers, the number base b = m^2k + m^2 - m + 1, and the power p = mn + m - 1. Then: * X_1 = \frac = (mk + 1) \sum_^ b^i is a Kaprekar number. * X_2 = \frac = X_3 + 1 is a Kaprekar number.


Kaprekar numbers and cycles of F_ for specific p, b

All numbers are in base b.


Extension to negative integers

Kaprekar numbers can be extended to the negative integers by use of a
signed-digit representation In mathematical notation for numbers, a signed-digit representation is a positional numeral system with a set of signed digits used to encode the integers. Signed-digit representation can be used to accomplish fast addition of integers because ...
to represent each integer.


Programming exercise

The example below implements the Kaprekar function described in the definition above to search for Kaprekar numbers and cycles in
Python Python may refer to: Snakes * Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia ** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia * Python (mythology), a mythical serpent Computing * Python (pro ...
. 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 nt 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


See also

*
Arithmetic dynamics Arithmetic dynamics is a field that amalgamates two areas of mathematics, dynamical systems and number theory. Classically, discrete dynamics refers to the study of the iteration of self-maps of the complex plane or real line. Arithmetic dynamics is ...
*
Automorphic number In mathematics, an automorphic number (sometimes referred to as a circular number) is a natural number in a given number base b whose square "ends" in the same digits as the number itself. Definition and properties Given a number base b, a natura ...
* Dudeney number * Factorion *
Happy number In number theory, a happy number is a number which eventually reaches 1 when replaced by the sum of the square of each digit. For instance, 13 is a happy number because 1^2+3^2=10, and 1^2+0^2=1. On the other hand, 4 is not a happy number because ...
*
Kaprekar's constant In number theory, Kaprekar's routine is an iterative algorithm that, with each iteration, takes a natural number in a given number base, creates two new numbers by sorting the digits of its number by descending and ascending order, and subtracts th ...
* Meertens number *
Narcissistic number In number theory, a narcissistic number 1 F_ : \mathbb \rightarrow \mathbb to be the following: : F_(n) = \sum_^ d_i^k. where k = \lfloor \log_ \rfloor + 1 is the number of digits in the number in base b, and : d_i = \frac is the value of each d ...
* Perfect digit-to-digit invariant * Perfect digital invariant * Sum-product number


Notes


References

* * * {{Classes of natural numbers Arithmetic dynamics Base-dependent integer sequences Diophantine equations Number theory