# Pretty $p^2$-congruences involving Stirling numbers of the both kinds

Let $$p$$ an odd prime number and $${n\brack {k}}$$ (resp. $${n\brace k}$$) be the Stirling numbers of first (resp. second) kind, such that: $$\sum_{k\ge0} {{n}\brack {k}}x^k = \prod_{j=0}^{n-1}(x+j)$$ $$\sum_{k\ge0} {{n}\brace {k}}\prod_{j=0}^{k-1}(x-j) = x^n$$ Let $$m$$ an integer such that $$1\le m\le p$$, we have

\begin{align*} {{p+m}\brack {p}}+{{p}\brace {p-m}}&\equiv 0 \pmod {p^2}\\ {{p+m}\brace {p}}+{{p}\brack {p-m}}&\equiv 0 \pmod {p^2} \end{align*}

This is probably not new. Where can one find a reference?

EDIT From @i707107 answer, for odd $$m$$ in the range $$3\le m \le p-2$$, we also have the nice

\begin{align*}{{p+m}\brace {p}}&\equiv {{p}\brack {p-m}} \pmod {p^3} \end{align*}

• I found this one: mathstat.dal.ca/FQ/Scanned/28-4/howard.pdf – i707107 Apr 3 at 22:13
• @i707107 thanks, That does answer the reference request. From this paper, we see that the congruences between Stirling and Bernoulli numbers which are needed to demonstrate the above pretty congruence between Stirling of both kinds date back to Glaisher (1900) and Nielsen (1923). Would you write your comment as an answer, so that my question can be settled? – René Gy Apr 4 at 18:24
• The second Stirling number identity should have $(x)_k$ falling factorial, instead of the product up to $n-1$. – i707107 Apr 6 at 16:02
• @i707107 I fixed it. – René Gy Apr 6 at 17:12

The first congruence

According to the linked paper in comments, we have for $$1\leq m, by (1.7) $${{p+m}\brack {p}}\equiv \frac pm \binom{p+m}m (-1)^m B_m^{(m)} \ \textrm{ mod }p^2.$$ Also, by (1.8), $${{p}\brace {p-m}}\equiv -\frac pm \binom{p-1}m B_m^{(m)} \ \textrm{ mod }p^2.$$ So, for your first conguence, we need to check if $$-\binom{p-1}m+(-1)^m\binom{p+m}m \equiv 0 \ \textrm{ mod }p.$$ Writing down the binomial coefficients, we see that their denominators are $$m!$$ and numerator is zero mod $$p$$. Thus, your first congruence is true for $$1\leq m.

For $$m=p$$, the Stirling's second kind gives $$0$$. The first kind is by (1.4), $${{2p}\brack {p}}\equiv -\frac{4p^3}{2(p-1)}\binom{2p-1}pB_{p-1} \ \textrm{ mod }p^3.$$ Let $$\nu_p(n)$$ be the $$p$$-adic valuation of $$n$$. Then we have $$\nu_p(\binom{2p-1}p)=0, \ \ \nu_p(B_{p-1})=-1.$$ The last one is by von Staudt-Clausen. This gives $$p^2|{{2p}\brack {p}}$$, the result for $$m=p$$ follows.

The second congruence

For even number $$m$$ in $$1\le m , by (1.3) and (1.5), $${{p}\brack {p-m}}\equiv -\frac pm \binom{p-1}m B_m \ \textrm{ mod } p^2.$$ $${{p+m}\brace {p}}\equiv \frac pm \binom{p+m}mB_m \ \textrm{ mod }p^2.$$ Thus, the second congruence follows by the same way the first congruence is treated.

For odd number $$m$$ in $$1\le m \le p$$, by (1.4) and (1.6), $${{p}\brack {p-m}}\equiv -\frac{p^2m}{2(m-1)} \binom{p-1}m B_{m-1} \ \textrm{ mod } p^3.$$ $${{p+m}\brace {p}}\equiv \frac{p^2m}{2(m-1)} \binom{p+m}m B_{m-1} \ \textrm{ mod } p^3$$ Also, by von Staudt-Clausen, the Bernoulli number does not have $$p$$ as a factor of denominator if $$m. Thus, we have the result.

For $$m=p$$, by von Staudt-Clausen, $$\nu_p(B_{p-1})=-1$$. So, $$p^2$$ divides both Stirling numbers. The result hence follows.

• As a corollary we have that the irregular primes are those primes $p$ for which there exists a positive integer $k$ smaller than $\frac{p-1}{2}$ such that ${p\brack 2k+1} \equiv 0 \bmod {p^2}$. When such a $k$ exists, $(p,p-2k-1)$ is an irregular pair which is also characterized by the equivalent condition ${p\brack 2k} \equiv 0 \bmod {p^3}$. This characterization of the irregular primes does not seem to be well known. – René Gy Apr 6 at 18:49