There is a newer version of the record available.

Published November 18, 2026 | Version 1.1

Kaprekar dynamics: papers, verification code and data

Authors/Creators

Description

Version 1.1 of the code and data record for research on Kaprekar's routine (iterating the descending-minus-ascending digit arrangement) in arbitrary integer bases.

New in this version: the paper Arrival times for the four-digit Kaprekar map in even bases (R. Galyavin, 2026), with its LaTeX source and ancillary bundle. For bases B = m·2n with m ≥ 5 odd, it gives the exact distribution of the number of steps needed to reach any union of the cycles inherited from base m, and a limit law with at most five atoms as n grows. In the bases 5·2n the proportion of inputs reaching the fixed point tends to 1033/1125 for n ≡ 0 and to 94/125 for n ≡ 2 (mod 4), against the values 3/4 and 15/16 conjectured by Devlin and Zeng (Integers 21, 2021). As the odd part grows, the number of steps to reach any cycle obeys a total-variation law that is uniform in n.

From version 1.0: the paper Cycles of the four-digit Kaprekar map in even bases (R. Galyavin, 2026), which determines all cycles of the four-digit Kaprekar map in every even base. It recovers Hasse and Prichett's classification for m = 5 and proves the even-base uniqueness pattern recorded by Chen, Ono, Schwartz and Thakur (J. Integer Sequences 29, 2026, Remark 28). The classification is formally verified in Lean 4.

Files. Each paper as PDF and LaTeX source, with its ancillary bundle of reproduction scripts in Python and C++ and reference results; the bundle of the cycles paper also contains the Lean 4 development with build instructions. 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.

Contact: rustem@galyavin.com

Files

COMMITMENTS.txt

Files (470.2 kB)

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:d726e4e3a1d826884cc093cee97592c1
136.0 kB Preview Download
md5:4f2f4b9665c1ada68483462ed9e6d740
31.5 kB Download
md5:117d3d2879f04943c14d06ad1ac77280
2.0 kB Preview Download
md5:0a4b8a2a49bad8d207be1c981c9a3ddd
782 Bytes Download

Additional details

Related works

Is supplemented by
Software: https://github.com/galyavin/kaprekar-dynamics (URL)
References
Journal article: arXiv:2606.20439 (arXiv)