OFFSET
1,2
COMMENTS
Jacques Touchard proved in 1933 that for the Bell numbers (A000110), Bell(p+k) == Bell(k+1) + Bell(k) (mod p) for all primes p and k >= 0.
REFERENCES
J. Touchard, "Propriétés arithmétiques de certains nombres récurrents", Ann. Soc. Sci. Bruxelles A 53 (1933), pp. 21-31.
LINKS
Amiram Eldar, Table of n, a(n) for n = 1..100
Eric Weisstein's World of Mathematics, Touchard's Congruence
EXAMPLE
The 7th prime is p(7) = 17, and the least k such that Bell(k+17)-Bell(k)-Bell(k+1) is divisible by 17^2 is k = 6: Bell(23)-Bell(6)-Bell(7) = 44152005855083266 = 17^2*152775106764994, thus a(7) = 6.
MATHEMATICA
a={}; np = 100; p = Prime[Range[np]]; For[i = 0, i < np, i++; p1 = p[[i]];
n = 0; While[!Divisible[BellB[p1 + n] - BellB[n] - BellB[n + 1], p1^2], n++]; a=AppendTo[a, n]]; a
PROG
(PARI) bell(n) = polcoeff(sum(k=0, n, prod(i=1, k, x/(1-i*x)), x^n * O(x)), n);
a(n) = {my(k = 0, p = prime(n)); while ((bell(p+k)-bell(k+1)-bell(k)) % p^2, k++); k; } \\ Michel Marcus, May 20 2017
KEYWORD
nonn
AUTHOR
Amiram Eldar, May 12 2017
STATUS
approved