Last summer, Zach Weinersmith of smbc comics blew my mind.

My reaction was basically in line with the bottom right panel:

The harmonic series grows to infinity unless you throw out numbers with a 9 in their denominator.

"Sometimes thWHAT? WHAT? But how in the…WHAT THE BALLS?!”

The harmonic series is the infinite sum 1+1/2+1/3+1/4+…, the sum of the reciprocals of every positive integer. Even though the terms get closer and closer to 0, the series goes to infinity, meaning it eventually gets bigger than any number you can throw at it. (The question is fun to think about, so I won’t spoil it for you, but Wikipedia has an explanation.)

It seems baffling that if we take away 1/9, 1/19, 1/29, and so on, the series converges instead. In fact, it's less than 90, which is frankly pitiful compared to the infinitude of the harmonic series.

One ingredient in making sense of this mystery is a puzzling fact: "most" large numbers have a 9 in them, so eventually you're throwing out an awful lot of the numbers from the harmonic series. This fact seems very strange to me because the intuition I have about numbers, primarily based on the one- and two-digit numbers we encounter the most, fails me. Based on those small numbers, it feels like only a little over 10% of numbers have a 9 in them. But that’s spectacularly incorrect: as the number of digits increases, it becomes virtually certain that a randomly selected number will have a 9 as one of its digits.

It's not too hard to see why most large numbers have a 9 in them. Like a lot of probability puzzles, most famously the birthday problem, you can approach the question from the opposite direction. In this case, instead of directly figuring out how many numbers there are of a certain size and how many contain a 9, I can compute the probability that a given large number does not have a 9 in it.

Except for the first digit, which can’t be 0, there’s a 9/10 chance that any one digit in a multi-digit number is not a 9. (There’s an 8/9 chance that the first digit is not a 9.) So for a 2-digit number, there’s an 8/9×9/10, or 80%, chance that it doesn’t have a a 9 in it. For a 10-digit number, on the other hand, there’s an 8/9×(9/10)9 chance that it doesn’t have any nines. This is a much smaller chance, only about 34%. When we get up to 100 digits, there is less than a 0.01% chance that a randomly selected number is nine-less.

I can write that proof down, but my intuition for numbers gets in the way of my deeper understanding. Enter the prime tweetbot. Last summer I wrote about how much more interested I am in number theory than I used to be, and I think @_primes_ deserves a lot of the credit. Every hour, this bot tweets the next prime number. I enjoy scrolling through and retweeting the primes I find pleasing in some way.

In addition to helping me appreciate the aesthetic beauty of prime numbers, @_primes_ has helped me understand the nine-less harmonic series. When I last checked, of the 10 most recent prime numbers it had tweeted, 6 of them had a 9 in them. If you select any digit and scroll through the numbers, you’ll find the digit more often than your intuition might lead you to believe. You might have runs where one digit doesn’t appear for a while, but those are balanced by the long strings where they do appear. (For example, all the recent primes have a 2, 5, and 6 in them, and they will stay that way for a while.)

After noticing how many times each digit pops up on the prime number tweetbot, the idea that most big numbers do contain any individual digit just clicked into place. I'm actually not sure how I feel about that. On the one hand, it's satisfying to feel like I finally understand something that used to mystify me. On the other hand, there's one less thing in the world that makes me say "What the balls?!"
{"ft_lang_label":"__label__en","ft_lang_prob":0.94764084,"math_prob":0.88422364,"size":3814,"snap":"2019-51-2020-05","text_gpt3_token_len":924,"char_repetition_ratio":0.12834646,"word_repetition_ratio":0.015781922,"special_character_ratio":0.24200314,"punctuation_ratio":0.10653753,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.95214087,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-12-13T22:35:47Z\",\"WARC-Record-ID\":\"<urn:uuid:058e15b9-09b8-4d64-b1a6-5667474cbaa3>\",\"Content-Length\":\"51981\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:aaf89ff2-fd8e-4abf-9faa-776bc116916e>\",\"WARC-Concurrent-To\":\"<urn:uuid:9a10533e-45c7-457c-95be-08b6fddd8246>\",\"WARC-IP-Address\":\"151.101.250.49\",\"WARC-Target-URI\":\"https://blogs.scientificamerican.com/roots-of-unity/what-the-prime-number-tweetbot-taught-me-about-infinite-sums/\",\"WARC-Payload-Digest\":\"sha1:H755FDH7FZ7LCKLDNRAVH753ESE5Q35Y\",\"WARC-Block-Digest\":\"sha1:D3GCQ3X2PLTRLRKSDZGIJKXQTSHRHK2I\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-51/CC-MAIN-2019-51_segments_1575540569146.17_warc_CC-MAIN-20191213202639-20191213230639-00121.warc.gz\"}"}