Skip to content

Sunday Times Teaser 3338 – Any Way But Back

by BRG on 13 September 2026

by Howard Williams

Published Sunday September 13 2026 (link)

For her research on insect migration, Sophie has constructed a rectangular flat box in which insects travel from the SW corner to the NE corner. Inside are obstacles, arranged in rows and columns running from West to East and South to North, that the insects have to travel around, moving North or East, or (via a tunnel) diagonally through, moving NE. On each obstacle there is the option of closing the tunnel.

The total number of possible pathways across the box, with all tunnels open, is too big for Sophie’s purposes, but closing just one of the obstacles’ diagonal passages reduces the total number of possible routes by seven eighty-ninths.

What is the smallest number of obstacles that can be in the box?

From → Uncategorized

3 Comments Leave one →
  1. BRG permalink

  2. Frits permalink

    A mixture of Brian’s and Jim’s ideas.

    • BRG permalink

      I also tested your approach to computing D(m.n) but it didn’t make any difference to the speed on CPython. For reasons I don’t yet understand, your nc loop fails in my version.

Leave a Reply

Note: HTML is allowed. Your email address will not be published.

Subscribe to this comment feed via RSS