  Matrix Schubert varieties are affine varieties arising in the Schubert
calculus of the complete flag variety. We give a formula for the
Castelnuovo-Mumford regularity of matrix Schubert varieties, answering a
question of Jenna Rajchgot. We follow her proposed strategy of studying the
highest-degree homogeneous parts of Grothendieck polynomials, which we call
Castelnuovo-Mumford polynomials. In addition to the regularity formula, we
obtain formulas for the degrees of all Castelnuovo-Mumford polynomials and for
their leading terms, as well as a complete description of when two
Castelnuovo-Mumford polynomials agree up to scalar multiple. The degree of the
Grothendieck polynomial is a new permutation statistic which we call the
Rajchgot index; we develop the properties of Rajchgot index and relate it to
major index and to weak order.
