The detail

Of course it's not completely straightforward; but what one needs is a general, easily applied method that doesn't require some great feat of memory. Of course in the above n =5 case one could make an easy arrangement like the one in Cheney's card trick: there - to convey the numbers 1 to 6 by passing the last 3 cards (of the 4, the first was the suit i ndicator) - what one could agree upon is to order the 4 suits (and the cards within those suits), so that 3 cards would have a s mallest one, a m iddle one, and a l argest one, and then use the signals (s,m,l), (s,l,m), (m,s,l), (m,l,s), (l,s,m) and (l,m,s) to signal 1, 2, 3, 4, 5 and 6 respectively.

With n =5, A and P could agree in advance that the 24 numbers from 0 to 23 be divided into 4 blocks of 6, introduce a 4th variable, 't' say (with the understanding that s < m < l < t), and agree that (s,m,l,t), (s,l,m,t), (m,s,l,t), (m,l,s,t), (l,s,m,t) and (l,m,s,t) would represent 0, 1, 2, 3, 4 and 5, (s,m,t,l), (s,l,t,m), (m,s,t,l), (m,l,t,s), (l,s,t,m) and (l,m,t,s) would represent 6, 7, 8, 9, 10 and 11, etc, but one would soon realise how fraught with danger that could be (and it could so easily lead to the sort of fights that are reputed to happen sometimes amongst Bridge partners). And, DON'T FORGET to add ' i ' (see the 'Continuation' section below, or the later telegraphic worked example) to the decoded renumbered value of ' c[i] ' to finally know the actual hidden card.

A much more elegant solution is at hand if one knows about 'base factorial' representation (indeed had it not been at hand, one would have invented it for exactly this purpose):