Mathematician and ninja mathematical-thinking-prompter Alison Kiddle has been posting an image each day for the whole of August, each prompting some kind of mathematical question or discussion.
You're reading: Columns
Bouton numbers: a new integer sequence
In the 1901 paper that named the game Nim and provided its mathematical analysis, Charles Bouton defined “safe combinations”, positions that if you leave the game in this state, your opponent cannot win. In combinatorial game theory, these are \(\mathcal{P}\) positions (the previous player has already won), as opposed to \(\mathcal{N}\) positions (the next player can win).
Bouton gives a list of “the 35 safe combinations all of whose piles are less than 16”, working in three-heap Nim. Naturally it seemed sensible to check these, so I wrote a bit of Python code to do this. Bouton’s list is good. I realised I could easily adapt my code to find out how many \(\mathcal{P}\) positions there are for three-heap Nim games with other maximum heap sizes: 1, 2, 3, and so on.
And, having generated a sequence of integers, I naturally looked to see if it was in the OEIS. This is sometimes a good way to discover that your sequence of numbers is also found in some unexpected places. It wasn’t there! So I submitted it, and I just got the exciting email “N. J. A. Sloane published your changes”. So I present A363166: “Bouton numbers: a(n) is the number of P positions in games of Nim with three nonzero heaps each containing at most n sticks”.
This is my first OEIS submission, so it’s all very pleasing, even if I’m submitting a ‘new’ sequence inspired by a 1901 paper!
Carnival of Mathematics 218
The next issue of the Carnival of Mathematics, rounding up blog posts from the month of July 2023, is now online at Tony’s Maths Blog.

The Carnival rounds up maths blog posts from all over the internet, including some from our own Aperiodical. See our Carnival of Mathematics page for more information.
27 tickets that guarantee a win on the UK National Lottery – but what prize?
The recent preprint ‘You need 27 tickets to guarantee a win on the UK National Lottery‘ by David Cushing and David I. Stewart presents a list of 27 lottery tickets which will guarantee to match at least two numbers on the UK National Lottery, along with a proof that this is the minimum number you need to buy. The argument is clever and makes delightful use of the Fano plane.
I wrote some Python code that runs all 45,057,474 possible draws against these 27 tickets.
All draws had between 1 and 9 winning tickets from the set (crucially, none had zero!). Obviously for 27 of the draws one of the winning tickets matched all six numbers, but about 75% of the draws saw a maximum of 2 balls matched by the winning tickets, and a further 23.5% had at most 3 balls matched. This means almost 99% of the time the 27 tickets match just two or three balls, earning prizes which may not exceed the cost of the 27 tickets! (I recommend reading Remark 1.2 in the paper.)
More findings and my code on GitHub.
Update 1: Tom Briggs asked what’s the expected return for buying these 27 tickets. I think the average return is about £20, which is a £34 loss (and of course this is an average from a set of numbers that includes some big wins). Assumptions and details in the GitHub.
Update 2: Matt Parker prompted me to investigate what percentage of draws end in profit. Even though 99% of the time the tickets match just two or three balls, if more than one ticket matches three balls that would still be a small profit. In fact, a profit is returned in 5% of draws, though as noted above the expected return is a loss. Matt included this result in a fun video about the 27 tickets. Again, assumptions and details in the GitHub.
Interview: Kyle Evans on his 2023 Fringe show, Maths at the Museum
We spoke to friend of the site, award-winning maths communicator and past math-off competitor Kyle Evans about his Edinburgh Fringe show for 2023, which is about maths.
Carnival of Mathematics 217
The next issue of the Carnival of Mathematics, rounding up blog posts from the month of June 2023, is now online at Double Root.

The Carnival rounds up maths blog posts from all over the internet, including some from our own Aperiodical. See our Carnival of Mathematics page for more information.
Hexaflex yourself!
Hexaflexagons are great.
If you haven’t seen one before, you’re about to have a lovely time.
If you have seen them before, the reason I’m writing about them is that I’ve made a webpage that helps you create a template for a hexaflexagon with your choice of picture on each of the three faces.

