I know this is a dupe but can’t quite describe it correctly for the search.
What’s it called when you can cover all combinations of a set by sequentially entering numbers?
For example, consider the set {1,2,3,4,5} and I want to cover all the 3-digit combinations with a minimal number moves.
1,2,3,4,5,1,3,2 … would cover {1,2,3}, {2,3,4}, {3,4,5}, {4,5,1}, {5,1,3}, {1,3,2}, etc.
It’s called a De Bruijn sequence.