yup you guys are right ..i came up with the same answer.
But OA was A 31 and OE was 2^5 -1 .
I was reading this question on a math website, I guess the answer on the site is wrong. its should be 325.
I really hate all these Permutation/Compination formulas. Let think in simple logic way. As far as the combination of buttons pressed matters (I mean that combination 12 equals to combination 21) so we get only five possibilities for one button code pressed that are 1 or 2 or 3 or 4 or 5.
As for 5 button code we have - ONLY ONE possibility - all buttons pressed 1+2+3+4+5 (not 120 as permutation formula suggests).
Now lets think about 4 buttons combinations
Only five combinations.
I do not continue this boring counting, but for 2 buttons pressed we have 10 possible combinations, and for 3 buttons pressed we have 10 combinations also.
So, 5+10+10+5+1 gives us exactly 31. Sorry fot not using "rocket since approach" (permutation). I prefer old hacker's tools - paper and logic!
Have a nice day!
Don't worry, be happy!