### Random Post

### Recent Posts

### Recent Comments

### Archives

### Categories

- article (11)
- enigma (1,383)
- misc (4)
- project euler (2)
- puzzle (90)
- puzzle# (56)
- site news (61)
- tantalizer (101)
- teaser (7)
- today (1)

### Site Stats

- 240,810 hits

Programming Enigma Puzzles

27 March 2020

Posted by on **From New Scientist #2122, 21st February 1998** [link]

George has 27 small blocks which have been identified with 27 different prime numbers — each block has its number on each face. He has assembled the blocks into a 3×3×3 cube, as shown. On each of the three visible faces, the nine numbers total 320 — but this is not true of the three hidden faces.

George remembers that when he bought the blocks they were assembled into a similar 3×3×3 cube, but on that occasion they showed the same total on each of the six faces, this being the smallest possible total if each block has a different prime number.

What was the total on each face when George bought the blocks?

[enigma967]

%d bloggers like this:

We can see see the values of 19 of the 27 blocks (including the value 2, which must be hidden in the centre of the original arrangement), so we only need to find the values of the 8 “hidden” blocks.

There are 26 visible primes in the original arrangement, and we know that the 2 block must be the non visible value. So the smallest possible set of visible primes are those in the range [3, 103], and this includes all the primes were are shown in the diagram.

If we sum the values of each of the faces the grand total is 6× the face sum, but also 3×(corner pieces) + 2×(edge pieces) + 1×(middle pieces).

We can minimise this value by choosing the 8 smallest primes for the corner pieces, the next 12 for the edge pieces and the remaining 6 for the middles:

The grand total is then 3×98 + 2×612 + 552 = 2070.

In which case the sum for each individual face is 2070/6 = 345.

So we need to find if it is possible to assemble a cube with these constraints.

I used a

MiniZincmodel to find out. Here it is wrapped using theminizinc.pywrapper:Solution:When George bought the blocks the sum on each face was 345.Here is a diagram of a possible arrangement of the blocks to give a sum of 345 on each face: