Random Post
Recent Posts
Recent Comments
Archives
Categories
- amusements-book-1917 (1)
- article (11)
- braintwister (113)
- enigma (1,792)
- enigma-book-1982 (70)
- headscratchers-book-2023 (70)
- microteasers-book-1986 (11)
- misc (8)
- project euler (2)
- puzzle (90)
- puzzle# (249)
- site news (87)
- sphinx (20)
- tantalizer (311)
- tantalizer-book-1970 (84)
- teaser (7)
- today (1)
Site Stats
- 405,542 hits

Here is a solution using the [[
SubstitutedExpression]] solver from the enigma.py library.It runs in 80ms. (Internal runtime of the generated code is 1.1ms).
#! python3 -m enigma -rr SubstitutedExpression # E T E # x y z # ----------- # a b 2 1 # J U I N # c d e # ----------- # f g 2 h i 1 --literal="12" --distinct="EIJNTU" "{ETE} * {xyz} = {fg2hi1}" "{ETE} * {z} = {ab21}" "{ETE} * {y} = {JUIN}" "{ETE} * {x} = {cde}" --answer="({ETE}, {xyz})" --output="lambda p, s, ans: output_mul(*ans, pre=' ', start='', end='')"Solution: The reconstructed sum is: 969 × 199 = 192831.
import istr print( *[ f"ETE={ETE} ABC={abc}" for E in istr(range(1, 10)) for T in istr(set(range(10)) - {E}) for a, b, c in istr.product(range(1, 10), range(10), range(10)) if ( len(res1 := c * (ETE := (E | T | E))) == 4 and res1[2:] == "21" and len(set(E | T | (b * ETE))) == 6 and len(a * ETE) == 3 and len(res4 := (abc := a | b | c) * ETE) == 6 and res4[2] == 2 and res4[5] == 1 ) ] )