## Listener No 4686 – Dice Nets by Arden

Posted by Steve Tregidgo on 10 Dec 2021

I always enjoy the quarterly numeric puzzles, for the variety they inject into a heavy year of cryptic solves. I’ve noticed, however, that some numerics can be boiled down to management of lists: find a clue with a relatively small number of candidate answers, and see how its intersection with another entry can restrict one or the other. Sometimes there’s some maths involved too, where a lot of candidates can be discounted as logical impossibilities without actually making the lists, but often I end up writing out lists of numbers on a piece of paper. Or, more likely, copying a list from the Online Encyclopedia of Integer Sequences (OEIS) into a text file or spreadsheet, where I can delete impossible candidates over time. Sometimes I don’t even consult the OEIS but instead write a short program to generate the lists for me — and then instead of manually deleting candidates, I’ll program in restrictions (eg “make me a list of four-digit primes where the third digit is not 5”) as I whittle them down.

This week, I decided to see how far I could take that principle. Around half of the clues were simple lists of squares, triangles, primes or powers (or multiples thereof), all with known entry lengths, so it was easy enough to have the computer generate all of the candidates for each of those clues. Most of the other clues were dependent on the simple ones, and again it wasn’t too tough to have the program generate (for example) all possible N-length multiples of all possible candidates for some other answer. (Even the interdependent pair 16a and 31a could be bootstrapped, with a concession to logic: they had to sum to a three- or four-digit number which was both a triangle and a square, and there’s only one of those. So there weren’t too many candidates for that pair either.)

All the while I was filtering the candidates to just those which included digits 1-6 only. I think the largest candidate list was around 138: small potatoes for the computer, but unwieldy for pencil and paper. And they could be reduced further — all I had to do was tell the computer where the entries intersected. I typed up a table representing the intersections (having completely forgotten about the work I’d done for L4656, where I could describe entries and have it figure out the intersections for me), and instructed the program to eliminate any candidate where an intersecting entry could not hold the relevant digit in that position. (To put it simply: if all of 1a’s candidates started with 1, 2 or 3, and all of 1d’s candidates started with 2, 3 or 4, I could reduce both lists to those starting with 2 or 3 as the 1 and the 4 were impossible. I just had to repeat that for every possible intersection, which is easy work for a computer.)

That reduced the candidates for every entry decently, even down to a unique answer for some clues! I therefore added one more piece of logic: if a clue has just one candidate answer, remove it from all the other candidate lists (as answers are unique in this puzzle). Finally I just had the program repeat the process: eliminate based on intersections, then regenerate the dependent candidates, then intersect again, and so on. Within a second, the program printed out 37 unique answers for the 38 clues, and my grid was filled. (I didn’t bother with the candidates list for 5d. The number of possible three-prime combinations is huge, and my computer was not going to generate that list any time soon. It was a fully checked entry though, so I just confirmed its factorisation when the grid was filled.)

I did locate the dice nets manually (although I entered the grid in a spreadsheet to experiment more easily, as erasing coloured pencil is a pain).

Overall I think it took about the same amount of time to write the program as it would have taken me to solve by hand, and I’m left with something which I may be able to repurpose for a future puzzle (although since the fun was in writing it, not running it, I’ll likely revert to a manual solve again and use the program as a checker).

Thanks Arden for a fun workout, and for prompting some fun coding work outside of my day job!

## Leave a Reply