Consider the product "(p-1)! = 1\\cdot(p-1)\\cdot 2\\cdot (p-2)\\cdots k\\cdot (p-k)"
"1\\cdot(p-1)\\cdot 2\\cdot (p-2)\\cdots k\\cdot (p-k)\\ \\equiv\\ 1\\cdot (-1)\\cdot 2\\cdot (-2)\\cdots k\\cdot (-k)\\ \\equiv\\ -1 \\pmod{p}" (See Wilson's theorem).
"1\\cdot (-1)\\cdot 2\\cdot (-2)\\cdots k\\cdot (-k) = (-1)^k (k!)^2" Therefore:
"(-1)^k (k!)^2 \\ \\equiv\\ -1 \\pmod{p}""(k!)^2 \\ \\equiv\\ (-1)^{k+1} \\pmod{p}"
Comments
Leave a comment