Enigmatic Code

Programming Enigma Puzzles

Enigma 1052: Half-dozen doubled

From New Scientist #2208, 16th October 1999 [link]

SIX × TWO = TWELVE

In this problem each letter stands for a different digit and the same letter represents the same digit wherever it appears. No number starts with a zero. SIX, appropriately enough, must be a multiple of 6.

What is the 6-digit number represented by TWELVE?

[enigma1052]

2 responses to “Enigma 1052: Half-dozen doubled

  1. Jim Randell 23 July 2018 at 8:20 am

    This puzzle can be solved directly using the [[ SubstitutedExpression() ]] solver from the enigma.py library.

    The expressions can be specified on the command line, or as the following run file. Execution time is 130ms.

    Run: [ @repl.it ]

    #!/usr/bin/env python -m enigma -r
    
    SubstitutedExpression
    
    "SIX * TWO = TWELVE"
    "SIX % 6 = 0"
    

    Solution: TWELVE = 160380.

    The full sum is: 972 × 165 = 160380.

    By itself, the alphametic multiplication SIX × TWO = TWELVE has three solutions:

    965 × 218 = 210370
    972 × 165 = 160380
    986 × 345 = 340170

    The first of these is the only solution where TWO is a multiple of 2.

    The second of these is the only solution where SIX is a multiple of 6, and also where TWELVE is a multiple of 12.

  2. geoffrounce 23 July 2018 at 9:28 am
    % A Solution in MiniZinc
    include "globals.mzn";
     
    var 0..9: S; var 0..9: I; var 0..9: X; var 0..9: T; var 0..9: W;
    var 0..9: O; var 0..9: E; var 0..9: L; var 0..9: V;
    
    constraint S != 0 /\ T != 0 /\ all_different([S,I,X,T,W,O,E,L,V]);
    
    var 100..999: SIX = 100*S + 10*I + X;
    var 100..999: TWO = 100*T + 10*W + O;
    var 100000..999999: TWELVE = 100000*T + 10000*W + 1000*E + 100*L + 10*V + E;
    
    constraint SIX * TWO == TWELVE;
    constraint SIX mod 6 == 0;
    
    solve satisfy;
    
    output["Sum is " ++ show(SIX) ++ " X " ++ show(TWO) ++ " = " ++ show(TWELVE) ];
    % 972 X 165 = 160380
    

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: