← All papers
First page of Iterated block sorting and a maximum over primes

Iterated block sorting and a maximum over primes

Islam Mederov

math.NT Dec 1, 2026 · v1 math.CO
Kurkov's sorting identity is proved in Lean 4 against a community formal statement, with finite ranges checked via compressed certificates verified inside Lean.
We start with the positive integers in increasing order. At stage $t\ge2$ we fix the first $t$ entries and sort each remaining block of length $t$ in decreasing order if $t$ is prime and in increasing order otherwise. Let $b(j)$ be the eventual value at position $j$, and let $p_i$ be the $i$-th prime. We prove Mikhail Kurkov's conjecture that $b(p_{n-1}+1)=\max_{1\le i\le n}p_i(n+1-i)$ for every $n\ge2$ except $n=5$, when $b(8)=16$ and the maximum is $15$. David Wasserman used this same maximum to give a lower bound in the problem of Erdős, Freud and Hegyvári on least common multiples of adjacent terms in a permutation. We prove the sorting identity by counting entries at most a given threshold and checking a finite range of indices. We also formalize the identity in Lean. Each $b(p+1)$ with $p$ prime is a strict record, and the running maximum through position $x$ is asymptotic to $x^2/(4\log x)$.

An iterated block sort of the positive integers fixes the first t entries at stage t and sorts the remaining length-t blocks, decreasingly at prime stages and increasingly otherwise. Kurkov conjectured that the eventual value at position p_{n-1}+1 equals A_n = max_i p_i(n+1-i), a quantity linked to the Erdős–Freud–Hegyvári lcm permutation problem.

The proof counts the entries at most a threshold B at block boundaries, using a partial-block recurrence, a backward bound and a transfer-of-margins lemma. These reduce the identity to arithmetic inequalities. Explicit prime-counting bounds handle n ≥ 10^6, and a finite computation covers the remaining range. Separately, a Lean 4 proof verifies a formal statement of the identity, re-deriving the prime bound internally and checking the finite ranges with compressed certificates.

The identity b(p_{n-1}+1)=A_n holds for all n≥2 except n=5, where b(8)=16 and A_5=15. Each b(p+1) is a strict record, and the running maximum M(x) is asymptotic to x^2/(4 log x).

n23456789
p_{n-1}+1346812141820
A_n46101522334455
b(p_{n-1}+1)46101622334455
First comparisons of A_n with the sorted values