Maximizing minimal distance between consecutive brushstrokes when painting a checkerboard torus Suppose you have a 2-torus and you want to paint an $m\times n$ checkerboard pattern on it.
Every brushstroke could paint a single square. 
How does one maximize the minimal distance between consecutive brushstrokes? You can assume $m=n$ if that helps.

Here's the background of the problem. The next generation of eBeam machines that print reticles for semiconductor
manufacturing is "painting" the reticle with a grid of parallel electron beams, the beams being a certain distance
$\Delta$ from each other. Each beam exposes a pixel of size $\delta << \Delta$. The checkerboard mentioned above
has side $n = \Delta / \delta$.
After each exposure the grid of beams advances by a small amount and paints more pixels between those that already
have been exposed. One needs to perform $n^2$ exposured to complete the reticle in this interleaving manner.
Now, how fast can consecutive exposures be performed? That depends, among other things, on how close their positions
are modulo $n$. The heat absorbed by a pixel from a previous exposure may affect the sensitivity 
of the pixel in the next exposure if the pixels are too close too each other. Therefore one needs to schedule the
$n^2$ exposures in such manner so that the minimal distance between consecutive exposure positions modulo $n$ would be maximized.
Which is obviously equivalent to the question above.
 A: I asked some questions above about my understanding of the model. If I understand it correctly, I propose we choose the grid to be $(2p) \times (2p+1)$ where $p$ and $2p+1$ are both prime. (Such a $p$ is called a Sophie Germain prime and there are conjectured to be infinitely many of them.) Then paint at the multiples of $(p-2, p)$, wrapping around modulo $(2p) \mathbb{Z} \times (2p+1) \mathbb{Z}$. Consecutively painted squares will be $\sqrt{(p-2)^2 + p^2} \approx p \sqrt{2}$ apart and all squares sill be painted eventually. Since $p \sqrt{2}$ is about as far as two points can be in a torus of side length $\approx p$, this is close to optimal.
Note, however, that the squares two brush strokes apart are displaced by only $\sqrt{4^2+1^2}$, which is quite small. That's why I asked above if it is really okay to only focus on consecutive brush strokes.
A: Following the logic of the previous answer, choose any two primes $p,q$ and let $m=p,n=q.$
The map $$f_{a}:\mathbb{Z}/p \mathbb{Z} \rightarrow \mathbb{Z}/p \mathbb{Z}$$ defined by $x \mapsto ax$ is a permutation for any $a \in \mathbb{Z}/p \mathbb{Z}$ whenever $a\neq 0.$ Similarly for $q$.
For example, let the stroke sequence be the concatenation of the sequences
$$\{(f_{a}(t),f_{b}(t')):0\leq t\leq p-1\},
$$
in the order $t'=0,1,q-1.$ Then any two strokes $k$ time units apart will have distance lower bounded by $k\sqrt{a^2+b^2},$ provided 
$$k\leq \min ( \lfloor p/a \rfloor, \lfloor q/b\rfloor)
.$$
