Lookup without conditional statements
C, 28 bytes each
p(i){return&quot;@cefijk&quot;[i]&amp;15;}
b(i){return&quot;@bdghlm&quot;[i]&amp;15;}

This is basically the same as the answer by kirbyfan64sos, but uses a char array instead of integers, and has a dummy first byte so there is no need to subtract 1 from the function parameter.