d(n, m) = d(n - (2 k + 2), m - (2 k + 2)) for n, m > 2 k + 2. It yields formulas to calculate d(n, m) for every n and m.
To understand given explanations more carefully, implement the dynamics and find the pattern yourself.
There is also a tricky case k = 1. It yields to a bit different pattern:)
Remark. I want to emphasize that we have not just found the pattern and made a shamanistic hypothesis that it will be repeated. We have proved this. The stripes will alternate further, because every next stripe is uniquely determined by the previous stripe with width k.