### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,158)
- misc (2)
- project euler (2)
- puzzle (40)
- site news (44)
- tantalizer (42)
- teaser (3)

### Site Stats

- 177,972 hits

Advertisements

Programming Enigma Puzzles

12 June 2017

Posted by on **From New Scientist #2267, 2nd December 2000** [link]

Fill in the following cross-figure. No answer begins with a zero. The same base is used for all the entries, but it is not necessarily 10.

Across

1.A palindromic prime.

4.The square of the base being used.

5.A square.

Down

1.Three times my son’s age.

2.A prime.

3.A palindromic square.How old is my son?

[enigma1111]

Advertisements

%d bloggers like this:

If the base is

b, thenb²represented in basebis always 100. So this is the answer to 4 across.We are also told that 1 across and 3 down are palindromic numbers, so there are only 4 unknown values to place in the squares.

Additionally the smallest possible value for 1 down is 111. In base 18 this corresponds to 343 (decimal), which would make the son at least 114, so I don’t bother checking bases higher than this.

This Python program considers bases between 2 and 18 and creates a collection of alphametic expressions in that base, then uses the generalised alphametic solver (

SubstituedExpression()) from theenigma.pylibrary to look for solutions.It runs in 66ms

Solution:Your son is 37.The cross-figure is in base 7, and the filled out grid is:

1 across: 212 (base 7) = 107 (decimal), prime.

4 across: 100 (base 7) = 49 (decimal), 7².

5 across: 642 (base 7) = 324 (decimal), 18².

1 down: 216 (base 7) = 111 (decimal), 3× 37.

2 down: 104 (base 7) = 53 (decimal), prime.

3 down: 202 (base 7) = 100 (decimal), 10².

I used Jim’s analysis that the answer to 4 across is 100.

It is not very pretty code and I was not sure whether to post it, but it gets the answer in about 100 msec on my laptop. Fortunately, clue 3 down gives a unique answer for the number base, which is used for the rest of the code.