Teaser 2360: [Flower arranging]
From The Sunday Times, 16th December 2007 [link]
In the following statements and instruction, digits have been consistently replaced by letters, with different letters for different digits.
F + L + O + W + E + R raised to the power P is equal to the six-digit number FLOWER.
FACTOR is divisible by A, R and T.
What is the value of FLOWER ART?
This puzzle was originally published with no title.
[teaser2360]



Jim Randell 10:03 pm on 9 January 2026 Permalink |
Here is a solution using the [[
SubstitutedExpression]] solver from the enigma.py library.It runs in 226ms. (Internal runtime of the generated code is 126ms).
Solution: FLOWER ART = 390625 751.
And:
LikeLike
Ruud 6:11 am on 10 January 2026 Permalink |
import istr for f, l, o, w, e, r, p in istr.permutations(range(10), 7): if sum(istr("=flower")) ** p == istr("=flower"): for a, c, t in istr.permutations(range(10), 3): if istr("=flowerpact").all_distinct() and all(istr("=factor").is_divisible_by(x) for x in (a, r, t)): print(istr("=flower"), istr("=art"))LikeLike
ruudvanderham 11:32 am on 10 January 2026 Permalink |
This version is *much* faster. Note that it required the latest version of istr (1.1.16):
import istr for p in range(2, 10): for flower in istr.power_ofs(p, 100000, 1000000): if sum(flower) ** p == flower: istr.decompose(flower, "flower") for a, c, t in istr.permutations(set(istr.range(10))-set(flower)-{p}, 3): if istr("=flowerpact").all_distinct() and all(istr("=factor").is_divisible_by(x) for x in (a, r, t)): print(istr("=flower"), istr("=art"))LikeLike
GeoffR 2:48 pm on 10 January 2026 Permalink |
Note: P = 5 is max value for int_pow() can accomodate without an error, but OK for a solution.
LikeLike