It is well known that if $p$ is prime, Stirling numbers of the first and second kind, $s\_1(p,k)$ and $s\_2(p,k)$, are divisible by $p$ if $1<k\le p-1$ (Lagrange ; easiest is working in $\mathbb F\_p$ with the factorization of $X^p-X$). But is the converse true, i.e. is $n$ prime if all the $s\_1(n,k)$ (or $s\_2(n,k)$) are divisible by $n$ for $1<k\le n-1$? I checked it for $n<1000$ (hard to do much more with simple programs) ; the similar well-known result for binomial coefficients is not hard to prove using the explicit formula, but I have no idea for Stirling numbers.



Divisibility of Stirling numbers
The Stirling numbers of the first kind satisfy $x^{\underline{n}} = \sum\_{k=0}^n s\_1(n,k)x^k$. For $n > 0$ we have $s\_1(n, 0) = 0$, $s\_1(n, 1) = (-1)^{n-1}(n-1)!$, $s\_1(n, n) = 1$.


If $n > 1$ then $1^{\underline{n}} = 0$, so $\sum\_{k=1}^n s\_1(n,k) = 0$, or $$ \sum\_{k=2}^{n-1} s\_1(n,k) = -s\_1(n,n) - s\_1(1,1) = (-1)^n (n-1)! - 1$$


We need to deal with three cases of composite $n$:


1. $n=4$ can be handled as a special case: $s\_1(4, 2) = 11 \not\equiv 0 \pmod 4$.
2. $n$ has a non-trivial factorisation into distinct factors (i.e. $n=uv$ where $2 \le u < v$): $(n-1)! \equiv 0 \pmod n$ because both $u$ and $v$ are terms of the factorial.
3. $n = p^2$ is a prime square where $p > 2$: both $p$ and $2p$ are terms of the factorial, so again $(n-1)! \equiv 0 \pmod n$.


So if $n > 4$ is composite then $(n-1)! \equiv 0 \pmod n$, so the sum is non-zero $\bmod n$ and in particular cannot contain only terms which are zero $\bmod n$.


