**From New Scientist #2552, 20th May 2006**

That great artist Pussicato has just held an exhibition of 512 different paintings. Each painting consists of a three-by-three array of small squares and each square is coloured red or green. Pussicato gives each painting a value which he calculates as follows. He writes down the three horizontal rows, reading each from left to right, and the three vertical rows, reading each from top to bottom. This gives him six 3-sequences. He counts how many of the six are different and that is the value of the painting. For example, the diagramÂ has 3-sequences RRG, GRG, GGG, RGG, RRG, GGG and value 4.

How many paintings in the exhibition had (a) value 1, (b) value 2, (c) value 6?

[enigma1392]

### Like this:

Like Loading...

It’s straightforward to generate all the paintings and record the value for each one. This Python program runs in 35ms.

Solution:(a) 2 paintings have value 1; (b) 18 paintings have value 2; (c) 24 paintings have value 6.