For an odd prime, the hyper-factorial and double-factorial are connected by the relation $H(p-1) \equiv (-1)^{\frac{p-1}{2}}(p-1)!!(\mod{p})$

141 Views Asked by At

I have so far worked through the proof and stated that: $$H(p-1) = \prod_{k=1}^{p-1}k^k = \frac{(sf(p-1))^{p-1}}{sf(p-2)}$$ $$= \frac{(sf(p-1))^{p-1}(p-1)!}{sf(p-1)}$$ $$\equiv \frac{-1}{sf(p-1)} \equiv \frac{-1}{(p-1)!!}$$ by Fermats little theorem, Wilson's theorem and by the fact that $sf(p-1) \equiv (p-1)!! (\mod{p})$. I am struggling to prove the next part which states: \begin{equation} ((p-1)!!)^{-1}= \begin{cases} (p-1)!! & \text{if $p \equiv 3\mod 4$}\\ -(p-1)!! & \text{if $p \equiv 1\mod 4$}\\ \end{cases} \end{equation} Was wondering if someone could please help me clarify what is happening above? Apparently it has something to do with the following equivalence: $$((p-1)!!)^2 \equiv \Big(\frac{p-1}{2}!\Big)^2 \equiv (-1)^{\frac{p+1}{2}}(\mod{p})$$ but I cannot make the relation. Any help would be greatly appreciated.

1

There are 1 best solutions below

7
On BEST ANSWER

I do not know what sf means, but proving the congruences for $(p-1)!!$ is easy. Since $p-1$ is even (I assume $p>2$), $$ (p-1)!!=2\cdot 4\dotsb (p-1) = 2^{\frac{p-1}2}\Big(\frac{p-1}2\Big)!. $$ It follows that $$ (p-1)!! \equiv (-2)^{\frac{p-1}2} (p-1)(p-2)\dotsb(p-\frac{p-1}2)\pmod p. $$ Multiplying out, you get $$ ((p-1)!!)^2 \equiv (-1)^{\frac{p-1}2} 2^{p-1} (p-1)! \equiv (-1)^{\frac{p+1}2} \pmod p $$ by Fermat little theorem and Willson's theorem. This is equivalent to the congruence for $((p-1)!!)^{-1}$ in your question.