For integers e,f, not both zero, let W(ex2+fx;4) be the least N such that every four-colouring of {1,…,N} has two distinct integers of the same colour whose difference is ed2+fd for some integer d. Kumthekar, Gasarch, Regli and Whitehouse proved that W(ex2+fx;4)≤64(|e|+|f|)+1, and asked for the optimal constant C4 in a bound of this form, which they showed lies between 57 and 64. We prove that W(ex2+fx;4)≤57|e|+39|f|+1 for all such e,f, so C4=57. Both coefficients are attained, by x2 and by x2+x. The proof maps the lattice ℤ2 to the integers by (u,v)↦|f|u+|e|v, which turns the steps (d,±d2) into the differences ±(ed2±fd). With the steps for 1≤d≤7 the lattice graph is four-colourable by an 8×16 periodic tile, so near the axis f=0 no finite subgraph of it can be an obstruction on its own. There we use the fact that a colouring pulled back from the integers is invariant under the kernel of this map, and a SAT computation with a checked DRAT proof shows that every proper colouring of a 12×58 rectangle contains one of sixteen small configurations, each of which forces a periodic pattern that this invariance rules out. We also determine W(x2+jx;4) for 0≤j≤8; the values 82,81,75,89,73,53 for j=2,3,4,5,6,8 are new.
The arguments and the programs in this paper were developed and run by Astra (GPT-6.2 Astra, OpenAI) from Charles O'Neill's instructions. Two of the new threshold values, 82 and 81, were first proposed in those instructions; both were recomputed from the definition. The manuscript was prepared from the project's research records with Claude (Anthropic). All computations were re-run before release, and the programs and certificates are available at https://github.com/charlieoneill11/maths-releases.
Charles O'Neill chose the problem and directed the work. Charles O'Neill has checked the arguments and takes full responsibility for the correctness of the results.
@misc{quadratic-differences-2026,
author = {O'Neill, Charles and Kirkby, Max and {Astra}},
title = {The optimal constant for four-colour quadratic van der {W}aerden numbers},
year = {2026},
month = nov,
howpublished = {\url{https://charlesponeill.com/maths-releases/quadratic-differences/}},
note = {Preprint. Programs and data: \url{https://github.com/charlieoneill11/maths-releases/tree/main/quadratic-differences}},
}