# Review of "Optimal prime-period patterns halve the random rate of repeated colors in sums"

## Summary of the claim

Colorings of residues mod a prime $p$ with at most $k$ colors are scored by the fraction $F$ of all $p^2$ ordered pairs $(x,y)$ in which $x$, $y$ and $x+y$ do not get three distinct colors. The paper proves that the infimum $D_k$ satisfies $D_k \ge 3/(2k)$ for $k\ge 6$ and $kD_k \to 3/2$. It also proves that any sequence approaching the constant needs $p/k\to\infty$. Repeating these patterns on $[1,n]$ shows that the leading failure fraction for ordinary intervals is at most $3/(2k)$, half the $3/k$ leading term of the Hegde–Kumar–Pratibha construction. The paper says plainly that whether interval colorings can do better is still open.

The paper answers the question it asks. The answer is sharp, and it rests on a proof, not on the scan.

## Checks I ran

**Lower bound (checked by hand).** The identity $p^2F=\sum_A(3a^2-2T(A))$ follows from inclusion–exclusion over the three pairs of positions. Each pair contributes $\sum a^2$ because any two of $x,y,z$ determine the third. The Pollard step is correct. With $B=-A$ and $t=\lfloor a/2\rfloor\le a$, we have $\sum_d\min(t,r(d))\ge t(2a-t)$ once $a\le p/2$. At most $at$ of this comes from $d\in A$. When $0\notin A$, the uncapped count at $d=0$ adds $a-t$. That gives $T(A)\le a^2-t(a-t)-\mathbf 1_{0\notin A}(a-t)$. The per-class bounds $3a^2/2-1/2$ and $3a^2/2+a$ follow for even and odd $a$. Summing and applying Cauchy–Schwarz gives $p^2F\ge 3p^2/(2k)+p-a_0-1/2$. A class larger than $p/2$ gives $F>1/4\ge 3/(2k)$ when $k\ge6$. The claim $p/k\to\infty$ follows from the term $(p-1)/(2p^2)$. I found no gap.

**Tiling construction.** I checked the coset argument ($-1\in H$ because $2h\mid p-1$, and the $h$ cosets $jH$ are distinct) and the count $3h(h-1)$ of internal sums for $S_h$ when $p>3h$. Adding zero raises the failure count by exactly 1, as claimed. I also wrote my own brute-force counter. It builds every usable tiling with $h\le 11$ and $p<2600$ and counts failures directly over all $p^2$ pairs. All 517 tilings matched $6mh(h+1)+1$ exactly, and all satisfied the lower bound.

**Density input.** I read Blackburn–McKee §§7–8 in the cached text (`scout-rainbow-sums/data/splitter.txt`). Their "k-radius prime" is exactly the paper's test. Theorem 7.2 and the accompanying lemma give existence when $2h+1$ is prime. Theorem 8.1 gives the count $c_h x/\log x$ with $c_h>0$. So a usable prime lies in $[(1-\epsilon)X,X]$ for large $X$. Taking $h$ fixed, then $k\to\infty$, then $h\to\infty$ is valid. The citation is accurate.

**Baseline.** HKP Theorem 1.3 (cached PDF text) states the lower bound $1-(k-2)(k+1)/((k-1)(k+3))$ on the rainbow fraction, which is the $\approx 3/k$ failure construction, and the upper bound $1-1/k$ on the rainbow fraction. The paper reports both correctly. The new interval result therefore narrows the leading constant from $[1,3]$ to $[1,3/2]$.

**Numbers.** `table.py` reproduces `widths.csv` byte for byte (56,191 / 13,888 / 13,858; the prime file's hash matches). `verify.py` reproduces the $p=434{,}029$ witness exactly: 19,531,261 failures, $mF=1.607136$. `check_cells.cpp` reproduces `cells.csv`: no violations for primes through 19, and 3 and 35 violations mod 8 and 16.

## What should be fixed

1. **The table's note on zero rows is misleading for $h=4$.** The paper says a zero "means only that this test found no usable tiling in the scan." For $h=4$, no usable prime exists at all. A prime $p\equiv1\pmod 8$ has 2 as a quadratic residue, which puts 4 in the same coset as 1. (In Blackburn–McKee's terms, no special KM-logarithm of length 4 exists.) Readers should not be told this might be a scan artifact. Say which widths are provably empty and which ($h=14$) merely had sparse primes. The cleanest fix is to show only widths with $2h+1$ prime, since those are the ones the proof uses.

2. **The interval consequence should be a displayed statement.** For most readers the interval result is the reason to care: $\limsup_{k}\, k\cdot\lim_{n}(\text{min failure fraction on }[1,n]) \le 3/2$, against HKP's $3$. Right now it sits in prose in the last paragraph. One displayed corollary, stated with its order of limits ($n\to\infty$ first), would make the paper's contribution clear on first read. This is the single most useful change.

3. **Two cited checks have no code in this study.** The "81 partitions" coverage and failure check, and the "search over all partitions for periods 2 through 17", come from the scout study (`scout-rainbow-sums/check_prime.py` → `results/tiles.csv`, and `periodic.csv`). They are not in this study's replay. Either point to those files or drop the sentences. The theorem does not depend on them. My independent counter above covers the same ground for $p<2600$.

4. **Smaller clarity points.**
   - State Pollard's inequality with its hypothesis ($1\le t\le\min(|A|,|B|)$) and define the capped sum in words. Readers outside additive combinatorics will not know it.
   - Say in one sentence that the lower bound follows almost at once from the known single-set maximum (Huczynska–Jedwab–Johnson) plus Cauchy–Schwarz, apart from a rounding term. What is new is the exact handling of the zero class, the resulting $p/k\to\infty$ condition, and the matching partition. Saying so places the contribution honestly.
   - The finite-tilings section is long for what it supports. The scan does not carry the proof. One sentence, a few rows and the $p=434{,}029$ example are enough.

## record.json

The summary and findings are accurate. `so_what` is plain and correct. It could add that the method also beats the best previously known coloring of ordinary number ranges, since that is the part an outsider would find concrete. Importance 3 is defensible. The sharp constant applies only to a restricted class (prime periods), but the interval upper bound changes what specialists believe about the open HKP constant for large $k$. `type: finding` is correct.

## Recommendation

**Minor revisions.** The theorem is correct as stated, the external input is cited accurately, and every number I reran matched. The changes needed are wording (the $h=4$ row), presentation (a displayed interval corollary, a shorter scan section) and pointers to existing code.
