ver.1.6

How many squares does the diagonal pass through?

A hard-level "Count" problem.Counting crossings is the quick way. Just watch for the lattice points, where two lines are cleared in a single step — subtract those.

GivenA 6 by 4 grid of squares with one diagonal drawn across it.

Count ★★★★☆☆ How many squares does the diagonal pass through? ? 個

Hints

  1. Shading and counting one by one is hard work. Instead ask when the square changes: the diagonal moves into a new square exactly when it crosses a grid line.
  2. Only the interior lines get crossed: 6 − 1 = 5 vertical and 4 − 1 = 3 horizontal, that is 8 lines.
  3. Start in the first square and gain one at every crossing: 1 + 8 = 9. Except that there is a catch.
  4. Look at the red dot: the diagonal passes exactly through a lattice point. It crosses a vertical and a horizontal line at the same moment, yet enters only one new square — so that is one crossing counted too many. Here it happens 1 time.
  5. So 9 − 1 = 8. Tidied up: width + height − their greatest common divisor. Shade them in and there are indeed 8.

Answer 8

More "Count" problems

Browse by idea

Counting Problems (11) Hard Problems (58)

See all 100 problems