# Sunday Times Teaser 3212 – Changes at Chequers

*by Victor Bryant*

#### Published Friday April 12 2024 (link)

I started with a six-by-six grid with a 0 or 1 in each of its 36 squares: they were placed in chequerboard style with odd rows 101010 and even rows 010101. Then I swapped over two of the digits that were vertically adjacent. Then in three places I swapped a pair of horizontally adjacent digits.

In the resulting grid I read each of the six rows as a binary number (sometimes with leading zeros) and I found that three of them were primes and the other three were the product of two different primes. The six numbers were all different and were in decreasing order from the top row to the bottom.

What (in decimal form) were the six decreasing numbers?

6 Comments
Leave one →

With an improvement suggested by Frits:

The test in line 25:

is redundant and can be removed. The next two tests in lines 26 and 27 are sufficient to ensure that all values are distinct.

I left out more logic as it hardly brought down the run time. However, the unaltered row and the position of the vertical swap can be uniquely identified.