### Random Post

### Recent Posts

### Recent Comments

Brian Gladman on Enigma 1057: Recycled cha… | |

Jim Randell on Enigma 1057: Recycled cha… | |

geoffrounce on Enigma 452: Figure out these… | |

Jim Randell on Enigma 452: Figure out these… | |

Jim Randell on Enigma 1627: A riddle for the… |

### Archives

### Categories

- article (11)
- enigma (1,183)
- misc (2)
- project euler (2)
- puzzle (46)
- site news (46)
- tantalizer (49)
- teaser (3)

### Site Stats

- 184,903 hits

Advertisements

The following Python program is not particularly pretty, but it gets the answer (and the two possible methods of arriving at it) in 3.1s.

Solution:A=17 N=4 S=3 W=26 E=5 R=9.Here’s a slightly different approach, that works by constructing the possible sets of numbers of a certain length that sum to a certain number. It’s a bit more satisfying, and runs in 995ms, and I may be able to get it faster by tweaking the order the sums are considered in.

As Peter Hayes points out on the New Enigma site, you can simplify the requirements to two equations that contain enough information to solve the puzzle. This adaptation of the above Python program runs in 696ms.

MiniZinc produced a simple, fast solution.

It found 18 whole alphabet solutions in 149 msec.

All the solutions for A,N,S,W,E,R were as found previously, with the variations in values occurring in the letters B,C,D and J

@Naim: Did you get this to run in a reasonable time? I think considering the possible permutations of the 15 letters we’re interested in would be a lot faster that just randomly shuffling the entire alphabet. But even that doesn’t seem like would be an approach that would find the answer in a reasonable time.

Yes, a bit messy this week.

Not a particularly fast program:

Amazing what you can do with a bit of profiling:

Hi Arthur, How do you justify the maximum for r and e on line 7, i.e. 27 – (o+i+n+t)?

I got a few letters mixed up. The code should have been

we=orient ⇒w=orint<=26

⇒ rint≤26 ⇒ no letter

in rint >18

w=orint<=26 ⇒o≤26-rint

f=rint+e≤26 ⇒ e≤26-rint

h=orient-tree=orint-tre, orint≤26 ⇒orint-tre=h≤26

a=orient-re=oint. orint<=26 ⇒a=oint≤26

What do you mean no taxis?

We three kings of orient are

One in a taxi, one in a car

One on a scooter beeping his hooter

…

🙂

I think we used to sing: “one on a bike, and one in a car…”

Imagine a King getting into a taxi and saying “follow that star”

The algorithm is based upon “orient” word, and the word’s permutations are checked, and then some candidates are eliminated in order to satisfy the condition given in the problem.

ORIENT’s letters sum is 31 and ANSWER’s letters sum is a square number.