Books · The Fiddler: Solutions
Chapter 10
Have You Heard the Buzz?
You count aloud, starting from and working upward through the whole numbers. For any number that is a multiple of , or that contains the digit , you say “buzz” instead of the number. So the game begins where “buzz” has replaced , , and . How many times do you say “buzz” in the first turns?
The Fiddler, Zach Wissner-Gross, April 17, 2026(original post)
Solution
A number is buzzed when it is divisible by or contains the digit , so count each set and remove the double-count. Among : multiples of number ; numbers containing a number (units-digit , plus the seventies, with shared); numbers in both () number . By inclusion–exclusion,
The computation
Apply the rule itself to each of the first hundred numbers, buzzing on a multiple of or a digit , and count.
buzz = lambda n: n % 7 == 0 or '7' in str(n)
print(sum(buzz(n) for n in range(1, 101))) # 30
Extra Credit
In the first turns only of the numbers were buzzed, but the buzzed share climbs as the count goes on. Find the smallest such that, from the th turn onward, at least half of the numbers counted so far have been buzzed.
Solution
The pressure comes from the digit rule. Among the -digit numbers, the fraction containing no is , so the fraction containing a is . This first passes at , since but . Multiples of add a steady on top, so the running buzz fraction climbs through partway into the six-digit numbers. Tracking the cumulative count, it falls just short of half for the last time at , so from onward at least half the numbers so far have always been buzzed. (The source’s value is behind its paywall; this is my own.)
The computation
Count up through the millions, tracking the cumulative buzzes, and record the last turn at which fewer than half the numbers so far were buzzed. The answer is one past it.
cum, last = 0, 0
for n in range(1, 5_000_001):
if n % 7 == 0 or '7' in str(n): cum += 1
if 2 * cum < n: last = n # fewer than half buzzed so far
print(last + 1) # 708588 (no relapse out to 5,000,000)