## Brainteaser 1783: Nine, eight, seven, …

**From The Sunday Times, 17th November 1996** [link]

If you place a digit in each of the above boxes then you can read some numbers horizontally (left to right), vertically (top to bottom) and diagonally (top left to bottom right and bottom left to top right).

Your task is to place:

ninedigits, one in each box, so that you can then read …eightthree-figure numbers, at least …sevenof which are different primes, and so that at least …sixof the eight are palindromic, and so that at least …fiveof the digits in the bottom two rows are odd.Fill in the boxes.

This puzzle was included in the book *Brainteasers* (2002, edited by Victor Bryant) under the title “**Nine, Eight, Seven, Six, …**“. The puzzle text above is taken from the book. In the original puzzle the final condition (“**five** …”) was not included, and the required answer was just the value of the digit in the central box.

[teaser1783]

## Jim Randell 9:44 am

on2 January 2020 Permalink |If we label the grid as follows:

then the 8 numbers we are interested in are:

We can use the [[

`SubstitutedExpression()`

]] solver from theenigma.pylibrary to solve the puzzle directly, but it is a bit slow. (It takes over 5 minutes to run to completion).So we can do some analysis to make things a bit easier:

If a number is a palindrome, then it’s first and last digit are the same.

Looking at the 6 numbers:

ABC, GHI, ADG, CFI, AEI, GEC,we get the following graph equating the values of symbols if they are all palindromes:But at most 2 of them are not necessarily palindromes, and it is not possible to remove just 2 edges from the graph to form a disconnected segment.

Hence

A, C, G, Imust all be the same (odd) digit (say,X).So we can consider the grid:

and the 8 numbers are:

We see that the two diagonals take on the same value, so there are actually only 7

differentnumbers (all of which must all be prime), and 6 of the numbers are palindromes by definition, so we don’t need to worry about looking for additional palindromes.The following run file executes in 486ms.

Run:[ @repl.it ]Solution:The completed grid is:So the eight numbers are:

There are 7 different primes and 6 palindromes. The number 101 is repeated.

Without the constraint that at least 5 of the 6 numbers in the bottom two rows are odd we can also have the following reflection:

But in both cases the central square contains the digit 0.

LikeLike

## GeoffR 10:40 am

on3 January 2020 Permalink |I used Jim’s alternative grid to find a permutation solution

LikeLike

## GeoffR 3:56 pm

on6 January 2020 Permalink |I used two list comprehensions in Python to shorten my code, which also meant I could omit the palindrome function.

LikeLike