Enigmatic Code

Programming Enigma Puzzles

Enigma 1457: Anglo-Italian sums

From New Scientist #2618, 25th August 2007

Within each of these Anglo-Italian sums, digits have been consistently replaced by capital letters, different letters used for different digits. However, the three sums are entirely distinct — a letter need not have the same value in one as in either of the others. No number starts with a zero.

(a) FOUR + FOUR = OTTO
(b) TWO + TRE + FIVE = DIECI
(c) THREE + NOVE = DODICI

What are the numbers represented by OTTO in (a), DIECI in (b), DODICI in (c)?

[enigma1457]

Advertisements

2 responses to “Enigma 1457: Anglo-Italian sums

  1. Jim Randell 28 February 2013 at 9:46 am

    This Python program uses the SubstitutedSum() solver from my enigma.py library. It runs in 276ms.

    from collections import Counter
    from enigma import SubstitutedSum, printf
    
    sums = (
      # (a) FOUR + FOUR = OTTO
      SubstitutedSum(['FOUR'] * 2, 'OTTO'),
      # (b) TWO + TRE + FIVE = DIECI
      SubstitutedSum(['TWO', 'TRE', 'FIVE'], 'DIECI'),
      # (c) THREE + NOVE = DODICI
      SubstitutedSum(['THREE', 'NOVE'], 'DODICI')
    )
    
    r = Counter()
    for (n, p) in zip('abc', sums):
      for s in p.solve():
        r[p.result + '=' + p.substitute(s, p.result)] += 1
        printf("({n}) {p.result}={r} [{p.text} / {s}]", r=p.substitute(s, p.result), s=p.substitute(s, p.text))
    
    for (k, v) in r.items():
      printf("{k} [{v} solutions]")
    

    Solution: (a) OTTO = 2552; (b) DODICI = 101626; (c) DIECI = 10730.

    • Naim Uygun 28 February 2013 at 11:21 am

      By using the site http://www.iread.it
      Here are the results:
      FOUR+FOUR=OTTO:
      R O F U T
      6 2 1 7 5

      TWO+TRE+FIVE=DIECI:
      O E I T W R F V D C
      6 7 0 8 5 4 9 2 1 3
      6 7 0 8 4 5 9 2 1 3
      6 7 0 8 5 2 9 4 1 3
      6 7 0 8 2 5 9 4 1 3
      6 7 0 8 4 2 9 5 1 3
      6 7 0 8 2 4 9 5 1 3

      THREE+NOVE=DODICI:
      E I T H R N O V D C
      8 6 9 7 5 4 0 3 1 2
      8 6 9 4 5 7 0 3 1 2

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: