Enigmatic Code

Programming Enigma Puzzles

Tantalizer 409: Fe, Fi, Fo, Fum

From New Scientist #959, 24th July 1975 [link]

On the Mount of Mystery dwell those ostraglobulous giants Og, Gog and Magog. They can smell the blood of any Englishman within 400 leagues. So they spotted John Bull as soon as he came within range. But they let him get as far as the bar at the Pig and Whistle, while they finished their elevenses.

Then away they went. Og strode off in his five league boots, Gog in his six league boots and Magog in his seven league boots. Progress was speedy and John got a shock when he chanced to look though the bottom of his mug ten minutes later. Og was a mere nine leagues away, Gog a mere seven and Magog a mere ten.

Without going into gory details, can you say how far it is from the Mount to the Pig and Whistle?


5 responses to “Tantalizer 409: Fe, Fi, Fo, Fum

  1. Jim Randell 25 March 2020 at 7:50 am

    This Python program runs in 88ms.

    from enigma import irange, printf
    # possible distances for Magog (7n + 10)
    for d in irange(10, 399, step=7):
      # check distances for Gog and Og are integer steps
      if (d - 7) % 6 == 0 and (d - 9) % 5 == 0:


    >>> [d for d in irange(10, 399, step=7) if d % 6 == 1 and d % 5 == 4]

    Solution: It is 199 leagues from the Mount to the Pig and Whistle

  2. Brian Gladman 25 March 2020 at 4:21 pm

    This one is surely nonsensical. There are implications that the three giants set off at the same time, that their speeds are steady and that their stated distances from John Bull are measured at the same time. But by the time the giants get to 199 leagues they will be more than 50 leagues apart so they cannot be within 19 leagues of each other.

    • Jim Randell 25 March 2020 at 4:52 pm

      @Brian: Assuming they all travelled in a direct line (or at least all took the same route), they must have travelled a different number of steps to end up in the situation described. So if they are travelling together the ones with the shorter step distance must be making more steps to give them all a roughly constant speed.

Leave a Comment

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: