Enigmatic Code

Programming Enigma Puzzles

Enigma 233: Imagine an Enigma

From New Scientist #1379, 13th October 1983 [link]

In this week’s puzzle the ENIGMA is a whole number of gross, and IMAGINE another whole number of gross, over GO times as many as in the ENIGMA.

As usual each letter stands for a digit, and, different letters represent different digits.


Please work out what the letters stand for, and find the value of AGAIN.

Note: 1 gross is 12 dozen, i.e. 144.

Note: I am still waiting for a phone line to be connected at my new house, so I only have sporadic access to the internet at the moment. I’ve no idea when I will get connected.


3 responses to “Enigma 233: Imagine an Enigma

  1. Jim Randell 29 October 2014 at 12:35 pm

    This Python program runs in 44ms.

    from enigma import irange, diff, printf
    # consider 6-digit multiples of 144
    for i in irange(695, 6944):
      # calculate ENIGMA
      ENIGMA = str(i * 144)
      # split into letters
      (E, N, I, G, M, A) = ENIGMA
      # I cannot be 0 and they should all be different
      if I == '0' or len(set(ENIGMA)) != 6: continue
      # calculate IMAGINE
      IMAGINE = int(I + M + A + G + I + N + E)
      # it should be a multiple of 144
      (j, r) = divmod(IMAGINE, 144)
      if r > 0: continue
      # consider possible values for O
      for O in diff('0123456789', ENIGMA):
        GO = int(G + O)
        # IMAGINE / ENIGMA > GO
        if j > i * GO:
          AGAIN = A + G + A + I + N

    Solution: AGAIN = 64691.

    The letters are: A=6; E=2; G=4; I=9; M=5; N=1; O=0 or 3.

  2. Naim Uygun 29 October 2014 at 1:24 pm
    #enigma= 219456  again= 6 4 6 9 1
    from itertools import permutations
    for e,n,i,g,m,a,o in permutations(range(1,10),7):
        if enigma//144 != enigma/144: continue
        if imagine//144 != imagine/144: continue
        if imagine/enigma > go:
            print("enigma=",enigma, " again=",a,g,a,i,n)

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: