More generally, let N(n) be the number of possible codes for a n-button simplex lock.

Suppose you are choosing a code. Your first set of buttons can consist of 1 to n buttons. Let's say you decide to push i buttons. You can choose the set of i buttons in

ways. You can stop right there or go on to pick another set of buttons. If you decide to continue, there are N(n-i) codes left to (possibly) choose. So

Combined with

, this is sufficient to compute N(5). I calculate N(n) = 1, 5, 25, 149, 1081 for n = 1, 2, 3, 4, 5. Better check the calculations, I am notoriously unable to compute anything.

jw