Published November 22, 2026 | Version 1.13

Kaprekar dynamics: papers, verification code and data

Authors/Creators

Description

Version 1.13 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: a dated correction (22 November 2026), Correction to Conjecture 10 of Macroscopic cycles in odd-length Kaprekar dynamics (R. Galyavin), with its LaTeX source and ancillary evidence. Conjecture 10 (Strictness and survival) of Macroscopic cycles in odd-length Kaprekar dynamics is false at n = 35: for every integer B ≥ 232,892,391,600, a positive share of uniformly sampled 35-digit words, at least 35!/[(232,892,391,600)17·3818] ≈ 2.17·10−182, ends on a cycle in the chamber with peak normalized radius above 1/396, although 35 is not strict. The ancillary files hold the proof, the exact certificate, an independent reconstruction, literal-subtraction controls, and exact certificates for the codimension c(n) used in the note's open question. No theorem of the affected papers depends on the conjecture.

Added in version 1.12: the paper Capture times, radius bounds and periodic roots in odd-length Kaprekar dynamics (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. Inside the chamber of positive pairing, the gaps on the folded orbit of slot 1 evolve by an autonomous integer recurrence of order r (the folded order), and this recurrence is the clock: the probability that a start stays in the chamber and is captured by gap time T is O(((T+1)/B)k−d), with k−d = r at strict lengths and a matching lower bound at the 47 strict lengths of orders 3–13. Every wholly positively paired cycle has normalized peak radius at most 2/k + 6/B. The loss-free periodic points of the root recurrence with period dividing 2r are classified by a fixed finite graph, and an exact full-rank construction extends positive off-centre basin density to all twelve lengths of folded order 15. No population share beyond these lengths is claimed.

Added in version 1.11: the paper The arithmetic spectrum of Kaprekar lengths (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. It decides from the arithmetic of the word length which lengths can host macroscopic Kaprekar cycles inside the chamber of positive pairing. At a prime length the question reduces to whether an alternating walk of incomplete character sums on the cosets of ⟨−1,2⟩ surrounds the origin; at index two the walk is a Legendre walk ending at 1 − h(−4p). Unconditionally, at each fixed index, the prime lengths admitting such cycles have density zero; under the Riemann hypothesis for the relevant Kummer fields, almost every prime length admits none. Every odd composite length admits them, with explicit fixed points; among composites with two or three folded orbits only 9, 15 and 21 are strict. Exact certificates classify every odd length below 104. The results concern cycles lying entirely in the chamber; basin mass and cycles leaving the chamber are not decided.

Added in version 1.10: the paper Macroscopic cycles in odd-length Kaprekar dynamics: a chamber criterion and a residue-transfer rule (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. For every odd word length at least seven, it gives an exact criterion for macroscopic Kaprekar cycles inside the chamber of positive pairing: a nonzero zero-sum gap profile invariant under folded doubling, constant on the orbit of the first slot with the anchor, and satisfying weak linear inequalities. Such a profile gives fixed points at positive normalized distance from the centre on an unbounded base progression; without one, every cycle in the chamber has bounded absolute radius. When folded doubling has one orbit on the nonzero slots, a macroscopic cycle fails positive pairing or has a secondary breach proportional to the base within two folded turns before a maximum of gap energy. A residue-transfer rule, valid at every odd length, gives the joint support of exit residues of certified routes and, on base progressions with a stable support translate, their exact limiting weights by an inherited lattice index. The length 1069 lies outside the natural three-way classification of lengths. The paper proves no population share beyond earlier work.

Added in version 1.9: 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 (19.1 MB)

Name Size
md5:d1f76d488089ab3b751c82337d6adc65
689 Bytes Preview Download
md5:a5790cb7c0e0fb084a3b3e0f79a07b1f
118.6 kB Preview Download
md5:3c3d5aa473c81ae3d68a184fc1151f72
207.5 kB Preview Download
md5:651e7df80f83ac3efaa653afda7212f0
73.2 kB Download
md5:bbcc584248250268a24be4e7e5636e30
40.2 kB Preview Download
md5:e8d988bb1e129323bb0c31d39c3ccd56
162.2 kB Preview Download
md5:6f62d8e476b9d9f7098f9459fb0eaf6c
36.9 kB Download
md5:ba57aecc27bcbaf54cda1d81e6e7897d
346.4 kB Preview Download
md5:b9f2fa3403fc592680c69f24c07ecfff
247.1 kB Preview Download
md5:ca6fc1dc1022221161b8750e8565d431
88.9 kB Download
md5:0fe40dc6b444f7c133e105d33547e13c
131.6 kB Preview Download
md5:ea70a8bd8028dc5a1e695c71e57b8c3e
231.3 kB Preview Download
md5:26a87b2036bb388b6b7342dee2e08921
8.4 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:e494841814b41280db1dd8595f62fb24
1.4 MB Preview Download
md5:db940658c54411f18b8ab6c50441fb51
179.5 kB Preview Download
md5:039cc57820993c94295bade658de2f5d
68.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:64923635b1bc0b0053bb15bbcc5abc01
4.2 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)