Finding Waldo in π

The SMBC comic Convert included as the “Votey button” a challenge to extract a Waldo visual from the digits of π.

I present waldo.gif (here blown up to 25x size):

Blurry image of man with red and white toque

The pixel data in this gif are the 23,074,248th through 23,075,235th hexadecimal digits of π! (Equivalently, the 92,296,989th through 92,300,940th bits).

Over at the Hacker News thread discussing this page, user bscphil made this animation of finding this image in the first 100,000,000 hex digits of π:

This is a reduced preview, you can find the full resolution (about 27MB) at https://0x0.st/oq0Q.mp4.

Here’s a little Python script that will verify that this image is in π for you! First head over to pi2e.ch to download the first billion hexadecimal digits of π in the file pi_hex_1b.txt. (Or get the hexadecimal digits from a source of your choice!)

You also need the image manipulation package Pillow.

from PIL import Image

waldo = Image.open('waldo.gif')
pixdata = waldo.tobytes().hex()

with open('pi_hex_1b.txt') as fid:
    fid.seek(23074249) # 1 more to skip initial "3."
    pihexits = fid.read(988)

print(pixdata)
'1c688fc9a5ba54a16f1f…'
print(pihexits)
'1c688fc9a5ba54a16f1f…'
print(pixdata == pihexits)
# True!

Here are some more contenders. Starting at the 1,736,352nd hexadecimal digit:

Blurry face of man with red and white toque

Starting at the 205,108,988th hexadecimal digit:

Another blurry face with red and white toque

Starting at the 369,979,817th hexadecimal digit:

Another blurry face with red and white toque

(Yes, I cheated a bit on these. Can you figure out how?)

Written on March 31, 2022