Papers
Topics
Authors
Recent
Search
2000 character limit reached

Four-Digit Kaprekar Map Dynamics

Updated 4 July 2026
  • The four-digit Kaprekar map is a digit-rearrangement transformation that subtracts the ascending order from the descending order, yielding a finite dynamical system with a fixed point (6174) in base 10.
  • It employs state-space reduction techniques using digit differences and symmetry groups, such as the Klein four-group, to offer a clear classification of convergence and cycle behavior.
  • Its dynamics are base-dependent, exhibiting variations in fixed points and cycle structures, with computational studies confirming rapid convergence and a dominant attractor basin.

Searching arXiv for recent and foundational papers on the four-digit Kaprekar map. arxiv_search(query="four-digit Kaprekar map Kaprekar routine 6174 dynamics fixed point base-dependent", max_results=10, sort_by="relevance") arxiv_search(query="Kaprekar four digit base dependent behavior difference pair maximum distances", max_results=10, sort_by="relevance") The four-digit Kaprekar map is the digit-rearrangement transformation obtained by taking a four-digit string, forming the descending and ascending digit orders, subtracting the latter from the former, and iterating the result. In base $10$ it is the classical routine associated with the fixed point $6174$, discovered by D. R. Kaprekar in 1949, but the modern literature treats it more generally as a finite dynamical system on fixed-length digit strings, a reduced map on digit-difference coordinates, and a base-dependent family of maps with sharply different fixed-point and cycle structure across bases (Hanover, 2017, Smarandache, 2010).

1. Definition, notation, and state-space conventions

For a four-digit decimal number nn, the standard routine writes the digits of nn, rearranges them in descending order to form one four-digit number, rearranges them in ascending order to form another, subtracts the smaller from the larger, and repeats. A standard convention, used explicitly in the cited work, is that leading zeros are retained, so intermediate states such as $0990$, $0211$, or $0001$ are legitimate four-digit states (Smarandache, 2010, Hanover, 2017). In the most compact notation, the map is

K(n)=D(n)A(n),K(n)=D(n)-A(n),

where D(n)D(n) is the descending rearrangement and A(n)A(n) the ascending rearrangement.

The same definition is formulated in general base $6174$0. If a four-digit base-$6174$1 number has sorted digits

$6174$2

then the four-digit Kaprekar transform is

$6174$3

which the literature rewrites as

$6174$4

and equivalently

$6174$5

A direct decimal specialization yields

$6174$6

for ordered digits $6174$7; this shows immediately that every decimal output is divisible by $6174$8 (Hanover, 2017).

State-space conventions differ slightly across papers. Some work studies the full routine including the degenerate equal-digit case, where descending and ascending rearrangements coincide and the image is $6174$9 (Smarandache, 2010). Other work excludes repdigits from the admissible state space and studies only strings with at least two distinct digits (Hanover, 2017, Dahl, 23 Nov 2025). This difference matters for statements about attractors, convergence counts, and maximal distance.

2. Classical decimal dynamics and the role of nn0

For base nn1, the classical statement is that any four-digit number with at least two distinct digits reaches nn2 within at most nn3 iterations, and nn4 is fixed because

nn5

and the same subtraction recurs on the next step (Hanover, 2017, Devlin et al., 2020). Numbers with all digits identical are exceptional: they collapse to nn6, which is itself fixed in the full routine (Smarandache, 2010).

The decimal orbit structure is therefore dominated by two fixed points under the inclusive convention: the degenerate fixed point nn7, reached from repdigits, and the nonzero fixed point nn8, reached from every other four-digit decimal input. The literature represented here does not report a nontrivial periodic cycle for the classical decimal four-digit map; when cycles are discussed in the generalized setting, they are attached to larger digit lengths or to alternative operators rather than to the usual four-digit decimal routine (Smarandache, 2010, Hanover, 2017).

Worked trajectories illustrate the mechanism. A standard example is

nn9

after which the orbit is stationary. Another example showing the importance of retained leading zeros is

nn0

Repeated digits do not obstruct convergence unless all four digits are equal; for instance,

nn1

is a standard admissible orbit (Smarandache, 2010).

The computational distribution of convergence times is also nonuniform. For the base-nn2 four-digit case, the most common number of iterations required to reach nn3 is nn4 (Hanover, 2017). A different algebraic study, working with a restricted set nn5 and a parameter-class architecture, reports a maximum of nn6 transformations to the number nn7 within that convention; this should be read as a convention-dependent statement rather than as a revision of the classical “at most nn8 steps” theorem (Nuez, 2021).

3. Reduced state descriptions: digit gaps, difference pairs, and parametric forms

A major theme in recent work is that the four-digit map depends on far fewer degrees of freedom than the raw four digits suggest. In one formulation, a sorted four-digit number with digits nn9 is reduced to the difference pair

$0990$0

and the Kaprekar image is completely determined by that pair (Devlin et al., 2020). Devlin and Zeng use this reduction as the central state compression in their analysis of maximal distances, while earlier computational work cites Walden’s differential encoding, for example

$0990$1

to show that many distinct numbers have identical image behavior (Hanover, 2017).

A closely related decimal parametrization uses

$0990$2

for sorted digits $0990$3. In this notation the four-digit image is given explicitly by

$0990$4

and, for the special case $0990$5,

$0990$6

The same papers emphasize the exact criterion

$0990$7

where $0990$8. Under this convention the four-digit decimal problem collapses to $0990$9 parameter classes rather than $0211$0 admissible numbers (Nuez, 2021, Nuez, 2021).

The induced map on reduced coordinates can itself be written piecewise. Devlin and Zeng classify a difference pair $0211$1 as type (a), type (b), or type (c), and then define

$0211$2

through the case distinction

$0211$3

This reduction is the backbone of exact distance analysis in arbitrary bases with a nonzero four-digit fixed point (Devlin et al., 2020).

The reduced-state viewpoint is also the basis for fixed-point derivations. In the parametric transformation formalism of Nuez, the decisive map for $0211$4 is

$0211$5

and solving

$0211$6

gives

$0211$7

hence

$0211$8

Within that framework, $0211$9 appears not merely as a classical curiosity but as the unique parameter fixed point compatible with the relevant domain constraints (Nuez, 2021).

4. Finite-dynamical and algebraic structure

At the broadest level, the four-digit Kaprekar map is one instance of a self-map on a finite set, so every orbit must eventually repeat and therefore enter either a fixed point or a cycle. This finite-state viewpoint is explicit in the generalized theory of Kaprekar-type operators and explains why eventual periodicity is unavoidable even before any decimal-specific structure is used (Smarandache, 2010).

Several papers push this finite-dynamical viewpoint further by introducing equivalence relations based on coincidence after $0001$0 iterations. The relation

$0001$1

organizes the state space into higher-order equivalence classes. For four digits, first-order equivalence $0001$2 coincides with equality of the reduced parameters $0001$3, so the $0001$4-classes are exactly the parameter classes (Nuez, 2021, Nuez, 2021).

The first substantial algebraic symmetry appears at order $0001$5. In the four-digit case, the Set I equivalences act on parameter pairs by

$0001$6

with domains determined by the admissibility conditions. Nuez states that the product of these equivalences has an isomorphic group structure of the Klein group, and more specifically of the Klein four-group $0001$7 (Nuez, 2021, Nuez, 2021). This symmetry acts on parameter classes rather than on raw decimal strings and describes how distinct one-step classes merge after one additional Kaprekar step.

The same literature describes the four-digit decimal map as a rooted transformation tree centered on the fixed class $0001$8. In one detailed $0001$9 treatment there are K(n)=D(n)A(n),K(n)=D(n)-A(n),0 parameter classes, only K(n)=D(n)A(n),K(n)=D(n)-A(n),1 of which have inverse images, and these classes merge into K(n)=D(n)A(n),K(n)=D(n)-A(n),2 second-order K(n)=D(n)A(n),K(n)=D(n)-A(n),3-classes before higher-order identifications progressively collapse the whole system toward the root (Nuez, 2021). The same paper concludes that, within its K(n)=D(n)A(n),K(n)=D(n)-A(n),4 convention, the four-digit map has a single one-link cycle, namely the fixed point K(n)=D(n)A(n),K(n)=D(n)-A(n),5, and that by order K(n)=D(n)A(n),K(n)=D(n)-A(n),6 all classes are encompassed.

A useful misconception to avoid is that “same future behavior” is equivalent to “same multiset of digits.” The reduced-state papers show that the equivalence is coarser: different digit sets can yield the same reduced parameters and hence the same image. For example, K(n)=D(n)A(n),K(n)=D(n)-A(n),7 and K(n)=D(n)A(n),K(n)=D(n)-A(n),8 both have parameters K(n)=D(n)A(n),K(n)=D(n)-A(n),9, so both map immediately to D(n)D(n)0 (Nuez, 2021).

5. Dependence on the base: constants, fixed points, and terminal cycles

Base dependence is one of the main directions in the post-classical theory. One distinction that the literature makes sharply is between a four-digit Kaprekar constant and the existence of a four-digit nonzero fixed point. A base-dependent study reports, citing Hasse and Prichett, that the only bases with a four-digit Kaprekar constant are

D(n)D(n)1

with the corresponding constant

D(n)D(n)2

whose D(n)D(n)3 instance is decimal D(n)D(n)4; the same source states that the base-D(n)D(n)5 four-digit constant is D(n)D(n)6 (Hanover, 2017). A different line of work classifies instead the bases for which the four-digit map has a unique nontrivial fixed point, stating that this occurs iff

D(n)D(n)7

and for bases divisible by D(n)D(n)8 the fixed-point digits are

D(n)D(n)9

with decimal again giving A(n)A(n)0 (Devlin et al., 2020). These are different classification statements, and the distinction between “constant reached universally” and “nonzero fixed point exists” is essential.

Devlin and Zeng determine the maximal finite distance A(n)A(n)1 to the nonzero fixed point in every base where such a point exists. Their theorem includes the explicit values

A(n)A(n)2

together with the formulas

A(n)A(n)3

and, for the special regular family A(n)A(n)4 with A(n)A(n)5,

A(n)A(n)6

The same paper also studies the convergence fraction A(n)A(n)7; for A(n)A(n)8 with odd A(n)A(n)9,

$6174$00

showing that in such bases only a limited fraction of four-digit inputs converge to the nonzero fixed point (Devlin et al., 2020).

For odd bases, the structure is qualitatively different. A 2026 analysis proves that for every odd base $6174$01, after at most three iterations every nonconstant orbit enters the explicit triangular region

$6174$02

and on this region the four-digit Kaprekar map is conjugate to projective doubling,

$6174$03

under

$6174$04

This yields a complete description of all nonconstant terminal cycles. In particular, the longest terminal cycle has length at most

$6174$05

and equality can occur only when $6174$06 is prime; for primes $6174$07, equality occurs precisely when the least positive $6174$08 with

$6174$09

is

$6174$10

The same work gives an explicit counting formula for the number $6174$11 of terminal cycles of each length $6174$12 (Chen et al., 18 Jun 2026).

Even-base theory supplies a complementary perspective. In the general even-base classification of fixed points and cycles, successor digit sums are always divisible by $6174$13, and cycle structure in the symmetric and almost-symmetric classes is governed by multiplication by $6174$14 modulo $6174$15. For decimal base $6174$16, this yields $6174$17-cycles $6174$18 of length $6174$19 and $6174$20 of length $6174$21, although that full-index theory does not directly classify the ordinary four-digit decimal map because four digits cannot support a full decimal Kaprekar index (Kay et al., 2024).

6. Computational, graph-theoretic, and information-theoretic perspectives

Computational studies have repeatedly confirmed the classical decimal phenomenon while also exposing substantial hidden structure. One base-dependent study used C++ programs to iterate through all $6174$22-digit and $6174$23-digit integers, and for the base-$6174$24 four-digit case it checked all integers from $6174$25 to $6174$26, excluding multiples of $6174$27, verifying convergence to $6174$28. The same study reports that a difference-encoding and recursive caching scheme reduced runtime by a factor of $6174$29 relative to a brute-force implementation (Hanover, 2017).

Graphically, the four-digit decimal map is naturally represented as a directed graph or in-tree whose nodes are either concrete numbers, digit-multiset classes, or reduced digit-difference classes. In the base-$6174$30 case the graph is a rooted in-tree feeding the fixed node $6174$31, and path length to the root is exactly the iteration count (Hanover, 2017). This graph viewpoint is also central to the algebraic architecture developed by Nuez, where higher-order equivalence classes $6174$32 compress large portions of the inverse tree (Nuez, 2021).

A more recent information-theoretic treatment studies the four-digit map on the state space

$6174$33

of all four-digit strings with leading zeros allowed and at least two distinct digits, and defines the induced attractor distribution among trajectories that have already converged by time $6174$34,

$6174$35

For $6174$36, the reported picture is that the dynamics are effectively governed by a single large basin, all attracting cycles encountered are fixed points, the entropy drops rapidly in the first few iterations, and the normalized entropy drops close to zero, reflecting near-complete dominance of a single attractor. The same study states that most uncertainty about the eventual attractor is resolved within roughly five iterations (Dahl, 23 Nov 2025).

That paper also introduces a coarse gap-space representation with

$6174$37

For four sorted digits $6174$38, this is exactly

$6174$39

A direct specialization then gives

$6174$40

which suggests why the four-digit system is so compressible. Yet the same paper reports that simple low-dimensional features already have weak predictive power for exact convergence distance at $6174$41: the linear regression $6174$42 is only around $6174$43–$6174$44 for $6174$45, despite the globally simple basin structure (Dahl, 23 Nov 2025). A plausible implication is that the four-digit map is globally rigid but locally heterogeneous in its transient layering.

Across these computational and theoretical perspectives, the four-digit Kaprekar map emerges as a canonical finite dynamical system: exact and elementary at the level of definition, but structurally rich enough to support state-space reduction, group-theoretic symmetry, base-sensitive fixed-point theory, explicit maximal-distance theorems, and, in odd bases, a complete conjugacy to projective doubling.

Topic to Video (Beta)

No one has generated a video about this topic yet.

Whiteboard

No one has generated a whiteboard explanation for this topic yet.

Follow Topic

Get notified by email when new papers are published related to Four-Digit Kaprekar Map.