Enigmatic Code

Programming Enigma Puzzles

Sphinx Cryptarithm #19

From Sphinx Magazine #142, June 1933

The two words in the name of ROSEINNES from Yokoama are squares, while OR is a prime number.

What are these numbers?

The puzzle is credited to “M. Pigeolet (Anvers, Belgium)”.

[sphinx19]

2 responses to “Sphinx Cryptarithm #19

  1. Jim Randell's avatarJim Randell 11 February 2026 at 5:05 pm

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

    It runs in 77ms. (Internal runtime of the generated code is 1.5ms).

    #! python3 -m enigma -rr
    
    SubstitutedExpression
    
    "is_square(ROSE)"
    "is_square(INNES)"
    "is_prime(OR)"
    

    Solution: ROSE = 9216; INNES = 53361; OR = 29.

  2. ruudvanderham's avatarruudvanderham 11 February 2026 at 9:59 pm
    import peek
    import istr
    
    for r, o, s, e in map(tuple, istr.squares(1000, 10000)):
        if (o | r).is_prime() and istr(":=rose").all_distinct():
            for i, n in istr.permutations(set("012345679") - set(rose), 2):
                if istr(":=innes").is_square():
                    peek(rose, innes)
    

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