Locally sorted sequences
Your problem is solved in the paper Spheres of Permutations under the
Infinity Norm &mdash; Permutations with limited displacement by Torleiv Kløve.

See also A002524 and other sequences linked there. I found Kløve's paper by calculating the first few values of A002524 and finding it on the OEIS.