Find all the ways of placing all the digits 1 to 9 in the cells of a 3 x 3 board in such a manner that the seven three-digit numbers that can be read horizontally (from left to right), vertically (top to bottom), and diagonally (top left to bottom right) are pairwise relatively prime (i.e. they hay no common divisor greater than 1), but none is a prime itself.
The number of ways to create such an arrangement is exactly:
I tried to find a shortcut to the answer - for example, we know that no more than one of these numbers can be even, and that the bottom right digit cannot be even or a 5. But in the end, since this is labeled as computer-puzzle, I just wrote a program to check all the possibilities. There are only 9! of them.