[math-fun] Prime signature functions