#3009 - Number Shortage

@xkcd 15 2s, 12 3s.
13 2s, 10 3s.
12 2s, 9 3s.
10 2s, 8 3s.
9 2s, 7 3s.
8 2s, 6 3s.
7 2s, 5 3s.
6 2s, 4 3s.
5 2s, 3 3s.
4 2s, 1 3s.
\x00 2s, 0 s.

I'm curious about the implementation details. Buffer overflow? Div by zero? Just a plain segfault?

@jesterchen @xkcd
You'll need to chant the regex incantation that opens the portal to the numbers realm
https://youtu.be/5vbk0TwkokM
How on Earth does ^.?$|^(..+?)\1+$ produce primes?

YouTube

@bornach 🤣

I don't know what scared me more: that I understood the regex quite instantly (as soon as I had seen the input) or that I enjoy videos like that.

Thanks for sharing! 🙏

@xkcd I wonder how they counted the totals without using more numbers.
@phoerious @xkcd
They did the counts in Roman numerals?
@xkcd I was wondering what numbers would be needed to run out of both numbers at the same time, so I started at 1 2 and 1 3 and worked backward. Interestingly, there are steps where there could be more than predecessor. So it isn't just what values would they need to start with, but also how many pairs of values would work (within a given bounds; say numbers where both quantities are two digits but don't both remain two digits after the first iteration.)