Enigmatic Code

Programming Enigma Puzzles

Sphinx Cryptarithm #15

One response to “Sphinx Cryptarithm #15

  1. Jim Randell's avatarJim Randell 28 January 2026 at 10:23 am

    Here is a solution using the [[ SubstitutedExpression ]] solver from the enigma.py library.

    It runs in 78ms. (Internal runtime of the generate code is 801µs).

    #! python3 -m enigma -rr
    
    SubstitutedExpression
    
    # square root extraction:
    #
    #     x   B   y
    #    -----------
    #  \/ a b c d A
    #     e
    #     -
    #     f b c
    #       g h
    #     -----
    #         i d A
    #         i d A
    #         =====
    
    --distinct="AB"
    --invalid="0,aefgix"
    
    "sq({xBy}) = {abcdA}"
    
    "sqrx(0, {x}) = {e}"
    "{a} - {e} = {f}"
    
    "sqrx({x}, {B}) = {gh}"
    "{fbc} - {gh} = {i}"
    
    "sqrx({xB}, {y}) = {idA}"
    
    --answer="{abcdA}"
    --output="lambda p, s, ans: output_sqrx(ans, pre='  ', start='', end='')"
    

    Solution: The extraction is: √20449 = 143.

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Design a site like this with WordPress.com
Get started