Not looking at the above answers…
Ignore the first and last number. They are fixed and do not add to the number of combinations.
We now say we have as follows:
Second press can be 2, 3, 4
Third press can be 1, 2, 3, 4, but not the same as the second press.
Ditto on fourth press.
Fifth press can be 2, 3, 4 but not the same as the fourth press.
You might be tricked now into saying that there are 3*3*3*2=54 presses. But wait! If the fourth press is a 1, then you have 3 choices for press number 5. In this situation, the two stipulations (not equal to 1 and not equal to fourth press) are combined into one. So let’s consider the two scenarios separately.
Scenario 1: If fourth press is a 1:
We then have x, y, 1, z where x≠1, y≠x, y≠1, and z≠1. This gives us 3*2*3 = 18 combinations.
Scenario 2: If fourth press is not a 1:
We then have a, b, c, d where c≠1. Again, the situation splits into two scenarios. If b=1, there are more possibilities than if it is a different number. This is because c cannot be 1, and a cannot be 1, so making b=1 does not place any new limitations on these two numbers.
Scenario 2a: third press is 1, fourth press is not 1
We have a, 1, c, d. a can be any of 2, 3, 4. c can be any of 2, 3, 4. d cannot be the same as c, nor can it be 1, so it has just 2 options. The number of possibilities is 3*3*2 = 18.
Scenario 2b: third press is not 1, fourth press is not 1.
We have a, b, c, d. In this situation, nothing can be 1! a and d are out because they sit next to the ones on either end stipulated in the original problem. b and c are out because we are cornered into such a narrow scenario in which they are specified as not being 1. This means a has three choices, b has 2 choices (not equal to a or 1), c has 2 choices (not equal to b or 1) and d has 2 choices (not equal to c or 1) 3*2*2*2 = 24.
Now we’ve considered all the scenarios. The answer is the sum of all the situations, or 18+18+24 = 60. I think I made this more difficult than necessary and I’m not wholly convinced I’m right. I’ll look up at the other answers now.