Enigmatic Code

Programming Enigma Puzzles

Enigma 1130: Time and again

From New Scientist #2286, 14th April 2001 [link]

To practise my long multiplication I have taken two three-figure numbers (using six different digits between them) and multiplied the first by the second. Then, as a check, I multiplied the second by the first. The results are shown with dashes for all non-zero digits:

enigma-1130

What were the two three figure numbers?

[enigma1130]

Advertisements

One response to “Enigma 1130: Time and again

  1. Jim Randell 30 January 2017 at 7:43 am

    The intermediate multiplications in the sums are given in the opposite order (from top to bottom) than I would normally write them, and also I would normally use blanks to pad the right hand side, rather then zeros. But the form of the sum is clear.

    I used the general Alphametic solver (SubstitutedExpression()) from the enigma.py library to consider the multiplications (ABC × DEF) and (DEF × ABC). The digits ABCDEF are used for the two three-figure numbers and are all different, I use the lower-case letters abcdefghijklmnopqrstuvw to stand for the remaining non-zero digits, with Z standing for zero.

    This is the run file, which executes in 94.6ms.

    #!/usr/bin/env python -m enigma -r
    
    # 94.62ms (9.56ms internal)
    
    # use the alphametic solver
    SubstitutedExpression
    
    # solver parameters
    --symbols=ABCDEFabcdefghijklmnopqrstuvwZ
    --distinct=ABCDEF
    --assign=Z,0
    --digits=1-9
    --answer="(ABC, DEF)"
    
    # expressions to solve
    "ABC * DEF = abcdef"
    "D * ABC = gZhi"
    "E * ABC = jkl"
    "F * ABC = mnZo"
    "A * DEF = pZqZ"
    "B * DEF = rst"
    "C * DEF = uvw"
    

    Solution: The three-figure numbers are 534 and 216.

    Here are the two multiplications in full:

    enigma-1130-solution

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: