#Pyth, 11 bytes
Ms+Gm_+GdSH A function g that takes input of n and p via argument and prints the result. It can be called in the form gn p.
[Explanation coming later]
#Pyth, 11 bytes
Ms+Gm_+GdSH A function g that takes input of n and p via argument and prints the result. It can be called in the form gn p.
[Explanation coming later]