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 (19)
- tantalizer (310)
- tantalizer-book-1970 (84)
- teaser (7)
- today (1)
Site Stats
- 404,487 hits
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).
Solution: ROSE = 9216; INNES = 53361; OR = 29.
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)