A safe usually suggests a long list of separate attempts. But if the lock keeps checking only the last few digits typed, one continuous sequence can hide every possible code inside it. This is the idea behind de Bruijn sequences: arranging combinations so that they overlap with almost no waste.
The door that opens by itself
Riddle statement
A safe uses a 4-digit code, from 0000 to 9999.
You may type a sequence of digits as long as you like, one digit after another. The safe opens as soon as the last four digits typed match the correct code.
What is the shortest sequence that is guaranteed to open the safe, no matter what the code is?