Take the 2-minute tour ×  The question is how to calculate for
the general problem.  The specific problem is this:  Given a
door code of $n$ numbers on a 10 digit panel, how many
combinations do you have to try?  The catch is that the
mechanism that senses whether the correct code has been entered
has no concept of the start and end of the code. So the sequence
123456 is actually testing 3 unique door codes - my particular
case uses a 4 digit code.  The question is, given this
modification how many combinations are there given a code length
of $n$?  In answer to the comment:  Yes, I am looking for the
shortest sequence of digits that tests all combinations.
share|improve this question What do you mean by "how many
combinations"? Are you looking for the shortest sequence of
digits that tests all possible codes? –  Hans Lundmark Dec 7 '10
at 9:55 You may want to take a look at the de-Bruijn sequence
at: en.wikipedia.org/wiki/De_Bruijn_sequence –  user3533 Dec 7
'10 at 9:58 if you add that comment as an answer