← All work 14 / Research

KAPREKAR

I found a smaller exact description of a digit routine, then used it to pose a separate, testable question about model uncertainty.

Manuscript in preparation
Role
Independent researcher
Duration
2026
Team
Independent research
Status
Manuscript in preparation

Count the paths without keeping every starting point

Take a four-digit decimal number, allowing leading zeros. Sort its digits high to low and low to high, subtract the smaller arrangement from the larger, and repeat. Of the 10,000 starting states, 9,990 reach 6174 within seven steps. The ten with one repeated digit reach zero. I wanted to find out how much of that process could be compressed while keeping the counts exact.

I derived an ordered-gap factorization and a closed-form count of the one-step image. I used a smaller graph to describe the dynamics and exact multinomial weights to recover how many starting states flow to each destination. An independent oracle checked cycles, convergence depths and graph certificates across 49 configurations and 3,816,497 raw states. Core counting lemmas have Lean 4 proofs using Mathlib, and the Python verifier lets others reproduce the computational checks.

Make the AI claim earn its own evidence

I want to test whether gaps between sorted top-k logits help estimate uncertainty or route a model response. I designed the benchmark to give that idea a chance to fail. A no-free-lunch lemma already sets a limit: the current logits alone cannot tell us whether an answer is correct in every case.

The repository has a 17-page manuscript in preparation for arXiv, with no arXiv ID yet. The full image theorem still needs formalization. The LLM question remains a hypothesis.

Explore the research and verifier.

What the evidence says.

Configurations checked
49
Computational research record
Manuscript pages
17
Repository manuscript

An exact arithmetic instrument

Sort. Subtract. Repeat.

Arrange four digits from largest to smallest and smallest to largest. Subtract, keep leading zeroes, and repeat. Watch the same rule produce each step.

A mathematical demonstration, not evidence for the project’s AI reliability hypothesis.

Descending5432
Minus ascending2345
Difference3087

Example: 5432 − 2345 = 3087.

  1. 5432 − 2345 = 3087
  2. 8730 − 0378 = 8352
  3. 8532 − 2358 = 6174

Kaprekar Geometry and LLM Reliability / Workflow

How the digit routine becomes a smaller graph

  1. Define the digit routine

    Keep a fixed digit width, including leading zeros. Subtract the ascending digit arrangement from the descending arrangement.

  2. Extract ordered gaps

    Use differences between paired sorted digits to represent a state.

  3. Track the reduced graph

    Follow the dynamics on the smaller graph of gap states.

  4. Weight the basins

    Count the original states each reduced state represents using exact multinomial weights.

Worked explanationWork through 3524 → 6174
Input
Keep four decimal digits: 3524. Sort them into 5432 and 2345; their ordered gaps are 5 − 2 = 3 and 4 − 3 = 1.
Decision / rule
Subtract the ascending arrangement from the descending one: 5432 − 2345 = 3087. Repeat: 8730 − 0378 = 8352.
Outcome
One more step gives 8532 − 2358 = 6174. Then 7641 − 1467 = 6174, a fixed point.

Scope of this exampleAll-identical digits reach zero: 1111 − 1111 = 0000. A repeated pair is different: 1122 gives 2211 − 1122 = 1089. This arithmetic does not validate the separate LLM hypothesis.

The graph explains exact digit dynamics. The sorted-logit hypothesis has a separate benchmark.

What I’d do next.

  • Complete the Lean formalization of the full image theorem.
  • Test the sorted-logit reliability hypothesis against the benchmark rather than assuming it generalizes.