Kaprekar dynamics: papers, verification code and data
Authors/Creators
Description
Version 1.9 of the code and data record for research on Kaprekar's routine (iterating the descending-minus-ascending digit arrangement) in arbitrary integer bases.
Added in this version: the paper Off-centre Kaprekar cycles with positive basin density (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. Choose a nonconstant word of fixed odd length n uniformly in base B. At all 47 strict lengths of folded order 3 to 13 (the folded order is the least r with 2r ≡ ±1 mod n), there are Bn and cn > 0 such that, for every base B ≥ Bn, with probability at least cn the orbit ends on a Kaprekar cycle whose peak normalized distance from the centred profile exceeds a fixed δn > 0. At 15 and 17 digits these are cycles of period eight. At 45 and 91 digits, for each of the least periods 24 and 132, the probability of reaching a cycle of that period near one profile is bounded below for all large bases. At thirteen digits, in bases divisible by 7, two disjoint sets of inputs of positive probability reach one period-177 cycle, whose normalized radius is at most 24/B. The proved shares are tiny lower bounds and say nothing about the typical input. The proofs use exact certificates for guarded affine routes, lifted to actual subtraction with exact input weights.
Added in version 1.8: the paper Eleven-digit Kaprekar arrival laws modulo twelve (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. Choose an eleven-digit word uniformly in base B, excluding constant words, and let T_B be the number of subtractions to the first cyclic word. On an entrance event of probability at least 92.9921494990%, defined through a coupling of all bases by eleven uniform real digits, the normalized initial digit differences, T_B/B and the normalized differences of the first cyclic word have a joint weak limit along every base class modulo 12; these measures converge along every class modulo M if and only if 12 divides M. A clock kernel describes the limit: each repeated affine return is charged its limiting duration, and each admissible exit residue has probability equal to the reciprocal of its preimage index in the inherited input lattice. Some rank-one arrivals repeat only with period 66 in B, but the extra factor 11 disappears from the joint law. Convergence on the complement of the entrance event remains open. The proof uses exact polyhedral and lattice computations.
Added in version 1.7: the paper Arithmetic selection of arrival times in eleven-digit Kaprekar dynamics (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. For a uniformly random nonconstant eleven-digit word in base B, the joint law of the normalized input and the scaled arrival time T_B/B depends on the arithmetic of B. A fixed bounded test separates the subsequential limits along bases congruent to 0 and 1 modulo 6, so this joint law has no limit through all bases. On a small rectangle of initial gaps the conditional joint law converges along each class of B modulo 6 to six distinct explicit mixtures of affine clock graphs, so the joint law converges along no progression whose modulus is not divisible by 6. On a second box the conditional joint law converges along each of the classes B ≡ 5 and B ≡ 11 (mod 12) to two distinct explicit laws whose largest difference on [0,1]-valued tests is 17/7128; hence a system of limits along the classes modulo N would require 12 to divide N. Whether the full joint law converges along the classes modulo 12 remains open. The proofs use computer-assisted certificates of affine routes and their lattice weights.
Added in version 1.6: the paper Linear-time access for eleven-digit Kaprekar dynamics (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. For a uniformly random nonconstant eleven-digit word in base B, with probability tending to one through all bases, the six gaps between the symmetric digit differences are simultaneously at least ⌈(B+1)/7⌉ + 64 within 4509B subtractions. Consequently the time to the first cyclic word, divided by B, is tight, and the normalized differences of that word converge in probability to (5,4,3,2,1)/6. Exact cycles that never reach this gap condition exist for bases congruent to 0, 1 or 2 modulo 5. The proof combines almost-everywhere entry for the continuous leading map with a stopped energy estimate; its computer-assisted steps include an independent exhaustion of the periodic catalogue with exact rational infeasibility certificates.
Added in version 1.5: the paper Seven-digit Kaprekar dynamics: global law, two clocks, parity (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. For a uniformly chosen nonconstant seven-digit word in base B, the normalized starting differences and the arrival time divided by B have a joint limit along the bases of each parity. At almost every starting point the limiting time takes one of two values; the faster one has probability 3/8 in odd bases and 1/2 or 3/4 in even bases. Every arrival time is at most 54B + 614132 for B ≥ 400, and at first arrival the normalized differences lie within 34/B of (3/4, 1/2, 1/4). The proofs use an almost-everywhere entry theorem, exact integer returns and computer-assisted affine inequalities.
Correction in version 1.4: the cycles paper was revised to credit earlier work by M. Kahramanlar (the bases 3·2k, Zenodo, July 2026) and an anonymous preprint that stated the classification of the additional cycles as a conjecture (GitHub, August 2026).
From earlier versions: Cycles of the four-digit Kaprekar map in even bases (version 1.0, with a Lean 4 proof); Arrival times for the four-digit Kaprekar map in even bases (version 1.1), including the fixed-point basin limits 1033/1125 and 94/125 in the bases 5·2n, against the values 3/4 and 15/16 conjectured by Devlin and Zeng; A common arrival-time law for five-digit Kaprekar dynamics (version 1.2), with Lean 4 verification of its finite claims; and Majorization in odd-digit Kaprekar dynamics and the nine-digit arrival law (version 1.3), with five distinct nine-digit limits indexed by the base modulo 5.
Files. Each paper as PDF and LaTeX source, with its ancillary bundle of reproduction scripts and reference results; the bundles of the cycles paper and the five-digit paper also contain Lean 4 developments. Also LICENSE.md; COMMITMENTS.txt, which lists SHA-256 digests of unreleased research materials as a priority record; and SHA256SUMS for all files.
Licenses. Text, figures and data: CC BY 4.0. Code: MIT. See LICENSE.md.
Prepared with substantial AI assistance under the author's direction and close supervision; the author takes responsibility for the contents.
Author's website: galyavin.com.
Contact: rustem@galyavin.com
Files
COMMITMENTS.txt
Files
(16.0 MB)
| Name | Size | |
|---|---|---|
|
md5:d1f76d488089ab3b751c82337d6adc65
|
689 Bytes | Preview Download |
|
md5:bbcc584248250268a24be4e7e5636e30
|
40.2 kB | Preview Download |
|
md5:e8d988bb1e129323bb0c31d39c3ccd56
|
162.2 kB | Preview Download |
|
md5:6f62d8e476b9d9f7098f9459fb0eaf6c
|
36.9 kB | Download |
|
md5:5aff7d813f7957387596942a5a304bad
|
59.9 kB | Preview Download |
|
md5:b11f2e9a3e868afa0525bd6ab9f3be74
|
139.2 kB | Preview Download |
|
md5:43c775de6dcce379af1cd67866f9930b
|
32.5 kB | Download |
|
md5:94df4f9dd6d4c7255560fe1a3c90a976
|
10.7 MB | Preview Download |
|
md5:2344b953a6f5fed2f5aec19992399e28
|
202.9 kB | Preview Download |
|
md5:4a1cae057a77706e3e26e0557ea31ae0
|
78.9 kB | Download |
|
md5:b549a57693bfc17a4cf43739b0d0e3b9
|
829.2 kB | Preview Download |
|
md5:5072d2dd4b357d77fe66d2557caa911b
|
172.1 kB | Preview Download |
|
md5:9fc1c563905dfa7e2332c5c3157e2ddc
|
64.4 kB | Download |
|
md5:8d35a401d5cd74743b47bce3ff18937a
|
278.4 kB | Preview Download |
|
md5:ea8283a7f4411cf82db167cb1b558710
|
247.7 kB | Preview Download |
|
md5:98422fe72ed59123f7163ad18b0d7b91
|
101.5 kB | Download |
|
md5:720274ce2a88601a33d46ab3caff077b
|
299.8 kB | Preview Download |
|
md5:45f7117492503be307e37ff9a0025782
|
180.8 kB | Preview Download |
|
md5:acbfa5d7931225fc34f35e84b156848d
|
53.5 kB | Download |
|
md5:360b3d782db0c9f248ee06ab2d8c970c
|
902.1 kB | Preview Download |
|
md5:f0f7926c9a6016b79663d53a3ecfbcd4
|
159.7 kB | Preview Download |
|
md5:7ab20992ddeae1ddeb60a71a7adf2f7d
|
45.6 kB | Download |
|
md5:f3457f08359c9d9814a16162c10c8943
|
275.2 kB | Preview Download |
|
md5:fa804f3dd10f078bdfe3481c81799096
|
174.8 kB | Preview Download |
|
md5:b75cab6d18bfe28b578d4649dad82fb1
|
63.6 kB | Download |
|
md5:da257190832d4dc944749520bcdd9d03
|
450.0 kB | Preview Download |
|
md5:08795746b855f7f20ae4ed6530d1c2bc
|
150.8 kB | Preview Download |
|
md5:ae91af4bc603a60bb1a50e7c5cfc659d
|
45.7 kB | Download |
|
md5:117d3d2879f04943c14d06ad1ac77280
|
2.0 kB | Preview Download |
|
md5:e4cf481c1c206a1805e7b863b6a2c530
|
2.9 kB | Download |
Additional details
Related works
- Is documented by
- https://galyavin.com/ (URL)
- Is supplemented by
- Software: https://github.com/galyavin/kaprekar-dynamics (URL)
- References
- Journal article: arXiv:2606.20439 (arXiv)