Enigmatic Code

Programming Enigma Puzzles

Enigma 1362: Eight-fifths

From New Scientist #2521, 15th October 2005

If we assume that 5 miles = 8 kilometres what is the smallest integral number of miles that can be converted to its equivalent integral number of kilometres simply by rearranging the order of the digits of the number?

The publishing of this puzzle means that I now have all puzzles on the site from when I started doing programmed solutions to Enigma puzzles (with Enigma 1361 on 8th October 2005) to the most recent Enigma puzzle (Enigma 1780), which New Scientist have announced will be the last Enigma puzzle to be published.

There’s also a complete archive of the first 155 puzzles from Enigma 1 (22nd February 1979) to Enigma 155 (8th April 1982), and a handful of other Enigma puzzles, bring the current number of Enigma puzzles on the site to 577. This means there remain around 1,200 Enigma puzzles in back issues of New Scientist to track down and solve. (I don’t know the exact number, as some issues of the magazine had multiple puzzles, e.g. Enigma 243A, Enigma 243B & Enigma243C at Christmas 1983 and Enigma 544a & Enigma 544b at Christmas 1989, and sometimes the same puzzle is posted more than once, e.g. Enigma 9 & Enigma 83, or more recently Enigma 1757 & Enigma 1770).

[enigma1362]

Advertisements

2 responses to “Enigma 1362: Eight-fifths

  1. Jim Randell 23 December 2013 at 8:26 am

    I think it’s safe to assume that we’re interested in positive integers. This Python program runs in 34ms.

    from enigma import printf
    
    m = k = 0
    while True:
      m += 5
      k += 8
      if sorted(str(m)) == sorted(str(k)):
        printf("{m} miles = {k} km")
        break
    

    Solution: 1260 miles = 2016 kilometres.

  2. Hugh Casement 15 July 2016 at 2:35 pm

    If you take the true conversion factor 1.609344 you find the error in putting 1260 miles equal to 2016 km is nearly 12 km or over 7 miles! Much closer is 59 mi = 95 km (error 49 m).  Better still 325 mi = 523 km (error only 37 m or 70 parts per million).  Both mean reversing (not jumbling) the order of digits and are much less than 2016 km.  I therefore rate this Enigma as “strange”.

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s

%d bloggers like this: