There's a permutation list claimed to be the shortest that I used to carry in my PDA to impress friends that had one of those sorts of cars. If I recall, it was guaranteed to open the door in something like 32 button presses, but it may have been less.
It was because there was no "start" or stop to the sequence, the computer would unlock if the sequence appeared intact anywhere. So a code 3,4,5,6 would trigger with 8,2,7,3,4,5,6,0,2
>111211131114111511221123112411251132113311341135114211431144114511521153115411551212131214121512221223122412251232123312341235124212431244124512521253125412551313141315132213231324132513321333133413351342134313441345135213531354135514141514221423142414251432143314341435144214431444144514521453145414551515221523152415251532153315341535154215431544154515521553155415552222322242225223322342235224322442245225322542255232324232523332334233523432344234523532354235524242524332434243524432444244524532454245525253325342535254325442545255325542555333343335334433453354335534343534443445345434553535443545355435554444544554545555
625(?) presses, i was way off. :-( It's still a lot fewer than trying all 10,000 individual 4 digit possibilities that the keypad implies are there.
Also this is possibly not the shortest, according to some sibling comments to mine, above. This could be the upper bound?
Even 3 digit code would require over 60 keypresses.
We're there other constraints on valid codes?
Did the door unlock in a valid non-consecutive* subsequence like 3,4,5,0,6?
there's 5 buttons, and the code is four of those 5 in an arbitrary order. at least to my memory. it could have been 5 buttons in an arbitrary order. It's been 20 years!
5 pick 4 = 120, so that's an upper bound for my recollection. I remember it being fewer than that, but the original "paper" was a sheet of graph paper that had been scanned, i just transcribed it to my palm pilot.
oh. It isn't 120 * 4 keypresses. Because the thing that decided if the code was valid didn't have start/stop/reset states, so 1234523413452 would trigger 1234, 2345, 3452, 4523, 5234, 2341, 3413, 4134, 1345, and 3452. that would take "40 keypresses" in the OP "game", whereas it only takes 13 keypresses on these code pads.
so the paper was "an" shortest permutation that covered every possible combination.
edit: python gave a 625 keypress answer, i replied to a sibling with the full list of numbers.
It's different if the keypad gives an indication that one number is correct though, then it'll be 40 tries at most.
That shows how you can do a shorter sequence by using overlaps.
i assume my pc on a single core can do ~1billion permutations per second, this will take 19,647 millennia. AFK.
what do you think the chances are, if i let this run, that it would find a shorter solution than 625 keypresses? the naive De Bruijn algorithm popped that out in like 2 seconds.