2 min read

Unusual Crossword

Table of Contents

Puzzle

Here is an unusual crossword based on the first 3030 digits of π\pi.

ACROSS

1.A contiguous subsequence of digits from

14159265358979323846264338328

distinct from all the other answers (ignore the decimal point).

5.Same clue as above.

6.Same clue as above.

7.Same clue as above.

9.Same clue as above.

DOWN

1.Same clue as above.

2.Same clue as above.

3.Same clue as above.

4.Same clue as above.

5.Same clue as above.

8.Same clue as above.

Source. Composed by Johan de Ruiter for Pi Day, March 14, 2021;

Computational Solution

Here is the code for solving the puzzle:

from itertools import product
pi30 = "314159265358979323846264338328"
ss = {}
for l in range(2, 6):
    ss[l] = [pi30[i:i+l] for i in range(0,30-l+1)]

for a1,a5,a6,a7,a9 in product(*[ss[4],ss[5],ss[4],ss[5],ss[4]]):
    d1 = "".join([a1[0],a5[1],a6[1],a7[1],a9[0]])
    d2 = "".join([a1[1],a5[2],a6[2],a7[2],a9[1]]) 
    d3 = "".join([a1[2],a5[3],a6[3],a7[3],a9[2]]) 
    d5 = "".join([a5[0],a6[0],a7[0]])
    d8 = "".join([a1[3],a5[4]])
    d9 = "".join([a7[4],a9[3]])
    if a1 != a6 and a6!= a9 and a1 != a9 and a5 != a7 and \
        d1 != d2 and d1 != d3 and d2 != d3 and \
        d1 != a5 and d1 != a7 and \
        d2 != a5 and d2 != a7 and \
        d3 != a5 and d3 != a7 and \
        d8 != d9 and \
        d5 in ss[3] and \
        d1 in ss[5] and \
        d2 in ss[5] and \
        d3 in ss[5] and \
        d8 in ss[2] and \
        d9 in ss[2]:
        print("x" + a1)
        print(a5)
        print(a6 +"x")
        print(a7)
        print("x"+a9)

Here is the solution:

x 2 6 4 3
2 6 5 3 5
6 4 3 3 x
5 3 5 8 9
x 3 8 3 2