## You're reading: Travels in a Mathematical World

### 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!

### 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.)

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.

### Shoes and partition numbers: a developing mathematical mind wanders

Does this picture make you think of Srinvasa Ramanujan? I’m always fascinated by the pace and range of little conversations with my seven-year-old son that wander in and out of maths. Let me tell you how we got there during a five minute chat while leaving the house and walking to school this morning.

Some thinking aloud about what’s happening on social media in my world, I hope you don’t mind.

### customdice: a new LaTeX package for drawing dice

I made a new LaTeX package for drawing dice, customdice.

### What does craiyon/DALL·E mini ‘think’ mathematics and mathematicians look like?

You may have seen DALL·E mini posts appearing on social media for a little while now – it’s been viral for a couple of weeks, according to Know Your Meme. It’s an artificial intelligence model for producing images, operating as an open-source project mimicking the DALL·E system from company OpenAI but trained on a smaller dataset. Actually, since I had a play with this yesterday it’s renamed itself at the request of OpenAI and is now called craiyon. Since the requests all take between 1-3 mins to generate, I’m not going to re-generate all the images in this post using craiyon so that’s why they have the old ‘DALL·E mini’ branding.

AI image generation is a massively impressive technical achievement, of course. craiyon doesn’t create as stunning images as DALL·E 2, but still it can create some ‘wow’s.

What’s interesting, sometimes, is how it interprets a prompt. The data craiyon is trained on is “unfiltered data from the Internet, limited to pictures with English descriptions” according to the project’s statement on bias, and this can lead to problems including that the images may “reinforce or exacerbate societal biases”.

To see that in action, we can take a look at how the model manifests cultural expression around mathematics. When I gave it the simple prompt ‘mathematics’, it produced this.

### What we call mathematics

I notice in the news is an issue of whether we should have a different name for early maths. It’s actually quite interesting – and quite a problem – the different things we call ‘mathematics’.