Prime Number Rows in a Pascal's Triangle

What you discovered is that

For $p$ a prime number, and $n \in \{1, \dots, p-1 \}$, the binomial coefficient $$\binom{p}{n} = \frac{p!}{n!(p-n)!}$$ is divisible by $p$.

The proof is very simple. The fraction $$\frac{p!}{n!(p-n)!}$$ has a numerator divisible by $p$ ($p!= p \cdot (p-1) \cdots$) and has a denominator not divisible by $p$ (all prime factors of $n!(p-n!)$ are at most $p-1$).

Thus the fraction is divisible by $p$.

This is a very important fact in math, since it is used to prove that $$(a+b)^p \equiv a^p+b^p \pmod{p}$$ for all primes $p$.


Crostul's answer gives the simplest proof, but there is also a purely combinatorial way to show this. Consider the $k$-element subsets of $\{0,...,p-1\}$, and say two subsets are equivalent if one can be obtained from the other by adding $a$ to each element and reducing mod $p$, for some $a\in\{0,...,p-1\}$. This is an equivalence relation, and splits the $k$-element subsets into equivalence classes. We claim that if $0<k<p$ then each class has exactly $p$ subsets, so $\binom pk$ is $p$ times the number of classes. Clearly each class has at most $p$ subsets, and if a class has fewer than $p$ then there is some subset $S$ and two distinct $a,b\in\{0,...,p-1\}$ such that the subsets formed by adding $a$ to each element of $S$ (mod $p$) and by adding $b$ are the same. Thus $$0\in S\Longleftrightarrow a-b\pmod p\in S\Longleftrightarrow 2(a-b)\pmod p\in S\Longleftrightarrow\cdots$$ and since $p$ and $a-b$ are coprime, this means $S=\varnothing$ or $S=\{0,...,p-1\}$, contradicting our assumption on $k$.