One string of digits secretly contains every possible 4-digit code

To test all 10,000 four-digit PIN codes one at a time, you'd expect to need 40,000 digits. Is there a shorter string of digits that still contains every single one of those 10,000 codes somewhere inside it?

Reveal the answer

Yes — just 10,000 cyclic digits. A de Bruijn sequence overlaps consecutive codes, so each new digit you type completes a brand-new code instead of starting over. It's named after Nicolaas Govert de Bruijn, who formalized the construction in 1946, and the trick is now notorious among people who crack electronic combination locks.

— Nicolaas Govert de Bruijn, A Combinatorial Problem — Koninklijke Nederlandse Akademie van Wetenschappen, Proceedings, 1946

One credited idea per card. No filler. Swipe the rest in Savvy.

Keep swiping — it's free Works right in your browser. No app store needed.

More Puzzles

All Puzzles cards →

Five ideas worth knowing, every week

The week's best cards and a puzzle, credited as always. Free, unsubscribe any time.