Bell number modulo prime power

563 Views Asked by At

I'd like to ask how to fastly calculate the Bell number $B_n$ modulo a prime power, where $n$ is around one million.

1

There are 1 best solutions below

3
On

I'll answer my question by myself. This paper ("Congruences for Bell and Tangent Numbers" by Ira Gessel) proposed a favorable solution.