TITLE: If : $\binom{p-1}{k} \equiv (-1)^k \pmod p$ for all $k$ then $p$ is a prime?
QUESTION [6 upvotes]: Let $p$ be a prime, and let $1 \leq k \leq p - 1$ be an integer then :
$\binom{p-1}{k} \equiv (-1)^k \pmod p$

Proof :
Because $\binom{p-1}{k}=\frac{(p-1)(p-2)\cdots (p-k)}{k!}$ is an integer and $\gcd(k!,p)=1$
it sufficies to show that :
$(p-1)(p-2)\cdots (p-k) \equiv (-1)^k \cdot k! \pmod p$
which is evident .

Conjecture :
Let $k$ and $p$ be a positive integers such that : $p>4$ and $k\in [1,p-1]$
If : $\binom{p-1}{k} \equiv (-1)^k \pmod p$ for all $k$ then $p$ is a prime number .

I wrote Maple program . The statement is true up to $p=1500$ , and I guess that there is no counterexample at all.

REPLY [3 votes]: HINT $\rm\ \ mod\ p\!:\ {p-1\choose k}\equiv (-1)^k\ \iff\ (1 + x)^p\ \equiv \ 1 + x^p\ \ $ since
$$\rm (1+x)^{p-1}\ =\ \sum_{k\ =\ 0}^{p-1}\ {p-1\choose k}\ x^k\ \equiv \ \sum_{k\ =\ 0}^{p-1}\ (-x)^k\ \equiv\ \frac{1-(-x)^p}{1+x} $$