Sunday, April 19, 2026

Buzzing with excitement

The children's game called “Buzz” (also known as “Fizz buzz”) is where players take turns reciting whole numbers in order. However, in one particular variant of the game, anytime a number is a multiple of 7 or at least one of its digits is a 7, the player must say “buzz” instead of that number.

For example, here is how the first 20 turns of the game should proceed: 1, 2, 3, 4, 5, 6, buzz, 8, 9, 10, 11, 12, 13, buzz, 15, 16, buzz, 18, 19, 20.

How many times should “buzz” be said in the first 100 turns of the game (including those mentioned above in the first 20 turns)?

There are 14 multiples of 7 that are less than 100, since $100 / 7 = 14.2857\dots,$ so each of those numbers would be buzzes. Additionally, given that if we remove the possibility of there being a 7, then there are only 9 possible digits to choose from to make an up to two digit number with no 7s, that is a number from 0 to 99. Since we don't want 0 but do want 100, we see that there still are 81 possible numbers that do not contain any 7's, so that means that there would be 100 - 81 = 19 numbers that would buzz because they contain a 7. However, we have some overlaps, since 7, 70 and 77 are also multiples of seven, so from the inclusion-exclusion principle, the total number of buzzes in the first 100 numbers is $19 + 14 - 3 = 30$ buzzes.

As we just saw, in the first 20 turns of the game, 15 percent of the numbers were “buzzed.” But as the game proceeds, an increasing frequency of numbers get buzzed.

There is a certain minimum number $N$ such that, for the Nth turn in the game and for every turn thereafter, at least half the numbers up to that point have been buzzed. What is this value of $N$?

We can also encode a quick Python script to enumerate all buzzes in the first $N$ numbers:

def buzz(N):
    b = []
    for i in range(1,N+1):
        if i % 7 == 0:
            b.append(i)
        elif '7' in str(i):
            b.append(i)
    return b

By either a healthy amount of hunting and pecking, or some more systematic sounding of the phase space, we see that when $N = 708588$ that there are exactly 354294 buzzes, which is good for a ratio of 50% buzzes.

No comments:

Post a Comment