## A few words about PWW #25

In my previous post I made images like this:

What’s going on? Well, first, it’s easy to notice that each grid starts with $0$ in the upper-left square; $1$ is one square down and to the right of $0$, then $2$ is one square down and to the right of $1$, and so on….

When we get to an edge, we “wrap around” from the bottom to the top and/or from the right to the left. For example, in the grid above, notice how the $4$ is still one space to the right of the $3$, but in the top row; likewise, the $7$ is below the $6$ but in the left column; then the $8$ immediately wraps back around to the top row, and so on.

In other words, we can imagine that we are really making a straight diagonal line, but the bottom edge of the grid is “glued” to the top edge, and the right edge is glued to the left edge (making a torus, aka donut).

Equivalently, we can imagine gluing a bunch of copies of the grid together along their edges, and the numbers just count in a straight diagonal line, moving from one grid to the next, like this:

Although really, since each grid is supposed to be a copy, we should draw a diagonal sequence of numbers starting at $0$ in the upper-left corner of every copy!

So in this particular example, if we keep doing this, we eventually fill up the entire grid/space:

But sometimes that doesn’t happen; for example:

In this example, when we get to the $5$ in the bottom-right corner, we would have to wrap around to the top left again, but the $0$ is already there. So the process stops before we actually fill up the whole grid. This is why some of the grids have empty spaces in them. Here’s another slightly more interesting example:

So, what’s the difference? How can you tell whether a particular grid is going to fill up or have empty spaces left over?

Assistant Professor of Computer Science at Hendrix College. Functional programmer, mathematician, teacher, pianist, follower of Jesus.
This entry was posted in modular arithmetic, number theory, posts without words and tagged , , , , . Bookmark the permalink.

### 4 Responses to A few words about PWW #25

1. Jon Awbrey says:

CRT?

• Brent says:

Yes, that’s exactly where I’m going with this. =)

2. ZL says:

Looks to me like the grid will be filled if and only if its dimensions are coprime, thus forming an irreducible ratio. If the l:h ratio is reducible, the diagonal will run into itself before it can wrap around onto all tiles.