Starting with the numbers 1,2,7,42,429,7436, what is the next term in the sequence? This question arose in the area of mathematics called algebraic combinatorics, which deals with the precise counting of sets of objects, but it goes back to Lewis Carroll's work on determinants. The resolution of the problem was only achieved at the end of the last century, and with two completely different approaches: the first involved extensive verification by computer algebra and a huge posse of referees, while the second relied on an unexpected connection with the theory of ‘square ice’ in statistical physics. This paper, aimed at a general scientific audience, explains the background to this problem and how subsequent developments are leading to a fruitful interplay between algebraic combinatorics, mathematical physics and number theory.