galyavin.com

Papers and open-source software. Each item links to its own record: a DOI, a repository or a package.

A common arrival-time law for five-digit Kaprekar dynamics

doi:10.5281/zenodo.24330159  ·  github.com/galyavin/kaprekar-dynamics  ·  paper in the Kaprekar-dynamics Zenodo deposit, released as v1.2  ·  updated 2026-11-18

ResultFor five-digit Kaprekar dynamics the number of steps to a cycle, divided by the base, converges through all integer bases to one explicit continuous law; the maximum is B/3 + √B/3 + O(1), and cycle weights depend only on the base modulo 3.

LimitsFive digits only. The limit law is asymptotic and the explicit finite-base rate is conservative. Lean verifies the finite integer claims and the digit-to-pair reduction, not the probability laws.

Evidence

Written proofs; the finite integer-affine claims are checked by SMT for all bases and formally in Lean 4, with an independent re-derivation using separately written encodings, tests at fresh bases up to 2,560,009, and independent referee review. The law is expressed through a fold and a counted shear on two digit differences, with a finite rational algorithm for its distribution function at rational arguments and certified moment bounds. Code: github.com/galyavin/kaprekar-dynamics (release v1.2).

Arrival times for the four-digit Kaprekar map in even bases

doi:10.5281/zenodo.24329321  ·  github.com/galyavin/kaprekar-dynamics  ·  paper in the Kaprekar-dynamics Zenodo deposit, released as v1.1  ·  updated 2026-11-18

ResultExact distribution of the steps needed, in the four-digit Kaprekar map, to reach any union of the cycles inherited from the odd base m, for every even base m·2ⁿ with m ≥ 5; a limit law with at most five atoms; and, in the bases 5·2ⁿ, the share reaching the fixed point tends to 1033/1125 or 94/125.

LimitsFour digits only. Exact results need odd part at least 5 and targets made of lifted cycles; for the bases 10q with q > 1 odd the fixed-point distribution already follows from Devlin and Zeng. The uniform law’s constant (26/m) is far from sharp.

Evidence

Written proofs; the exact formula is checked coefficient by coefficient against direct subtraction and full enumeration (all 13,109,759 pairs in base 5120), limits recomputed in exact rational arithmetic, independent referee review. Its generating polynomial is an explicit sum over Oₙ(n) arithmetic progressions, and as n grows through a residue class modulo the order of 2 modulo m the arrival time divided by n converges to a law with atoms only at 1, 2, 3, 4, 5 and at infinity. Values 3/4 and 15/16 had been conjectured by Devlin and Zeng. Code: github.com/galyavin/kaprekar-dynamics (release v1.1).

Cycles of the four-digit Kaprekar map in even bases

doi:10.5281/zenodo.24325110  ·  github.com/galyavin/kaprekar-dynamics  ·  paper in the Kaprekar-dynamics Zenodo deposit, released as v1.0  ·  updated 2026-11-17

ResultDetermines every cycle of the four-digit Kaprekar map (sort the digits, subtract the ascending arrangement from the descending one) in every even base, and proves which even bases have exactly one cycle: 3·22k+1, 5·22k+1 and 7·2ⁿ with 3 not dividing n.

LimitsFour digits only. For the bases 5·2ⁿ the classification was already known (Hasse and Prichett, 1978). Arrival-time results are in a separate, later paper.

Evidence

Written proofs; the classification is formally checked in Lean 4, with numerical checks in every even base up to 1000. Writing the base as m·2ⁿ with m odd and m ≥ 5, the cycles are the lifts of the cycles of the odd base m, scaled in their difference pairs by 2ⁿ, together with at most one more: a cycle of length n+1 when 2ⁿ ≡ 1 (mod m), and one of length 2(n+1) otherwise. In base ten the map sends every input whose digits are not all equal to Kaprekar’s constant 6174. Code: github.com/galyavin/kaprekar-dynamics.

New lower bounds for the Ramsey numbers R(3,18) and R(4,18): witness graphs

doi:10.5281/zenodo.24285935  ·  record, published  ·  updated 2026-11-16

ResultTwo witness graphs give the lower bounds R(3,18) ≥ 101 and R(4,18) ≥ 212, each above the bound the published literature carried before this deposit.

LimitsLower bounds only: a witness graph shows a bound, it does not bound the Ramsey number from above, and no upper-bound or exact-value claim is made here.

Evidence

Witness graphs and a checker are in this record. Each graph carries its edge list and the checker recomputes the clique and independent-set bounds from it.

pi-tuck

github.com/galyavin/pi-tuck  ·  npm package · v1.3.2  ·  open-source software, work in progress  ·  read 2026-11-18

ResultCompaction for Pi that makes no model call: it builds the summary from the session itself, took a median 0.08 s per cut in a 128k live run, costs no tokens, and keeps earlier history readable back word for word with tuck_recall.

LimitsA Pi extension, work in progress, so the interface and defaults can change. Every measured number names the pi-tuck build and window it was run on; the retention claim covers cuts 1 to 4 only, against Pi’s compaction without recall tools.

Evidence

Install: pi install npm:pi-tuck. Source, README, benchmarks and issue tracker: github.com/galyavin/pi-tuck. The README’s own comparison against Pi 1.4.0’s built-in compaction reports 258 of 300 tasks resolved at a 128k window against 251 for built-in (its registered claim is only "no loss larger than 0.4 points"), and 120 of 150 against 94 at 32k on one model; each row names the build it was measured on, and the release you install may be newer. This entry was re-read against the repository on the date in the line above, and the entry describes the project as the README presents it there: README at main f3ecb2a9b9744fa967c0382d0ea540f29dfafdc0, README sha256 6dbea9fed240de10caae3851935506953e593d4daf735a9b786ce6373e9ec1da, 2026-11-18.