Enigmatic Code

Programming Enigma Puzzles

Puzzle 83: Division: some letters for digits, some missing

From New Scientist #1134, 21st December 1978 [link]

In the following division sum, some of the digits are missing, and some are replaced by letters. The same letter stands for the same digit wherever it appears.

Puzzle 83

Find the correct sum.

[puzzle83]

Advertisements

One response to “Puzzle 83: Division: some letters for digits, some missing

  1. Jim Randell 25 January 2017 at 8:45 am

    We can solve this puzzle directly using the SubstitutedDivision() solver from the enigma.py library:

    This run file executes in 183ms.

    #!/usr/bin/env python -m enigma -r
    
    # solver to use
    SubstitutedDivision
    
    # the division sum
    "t?mp? / ?? = ?xt"
    
    # the intermediate subtraction sums
    "t?m - y?? = ya"
    "ya? - ymx = x"
    "x? - ?a = 0"
    

    Or, with a bit more work, we can use the generic alphametic solver – SubstitutedExpression() – also from the enigma.py library, which executes a bit quicker, in 87ms.

    #!/usr/bin/env python -m enigma -r
    
    #            A x t
    #      -----------
    #  B C ) t D m p E
    #        y F G
    #        -----
    #          y a p
    #          y m x
    #          -----
    #              x H
    #              I a
    #              ===
    
    # solver to use
    SubstitutedExpression
    
    # solver parameters
    --symbols="amptxyABCDEFGHI"
    --distinct="amptxy"
    
    # the division sum
    "Axt * BC = tDmpE"
    
    # the multiples
    "A * BC = yFG"
    "x * BC = ymx"
    "t * BC = xH"
    
    # the intermediate subtraction sums
    "tDm - yFG = ya"
    "yap - ymx = x"
    "xH - Ia = 0"
    

    Solution: The correct division sum is 20304 ÷ 27 = 752.

    puzzle-83-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: