OFFSET
1,2
COMMENTS
p is in A007540 iff a(n) == 0.
LINKS
Robert G. Wilson v, Table of n, a(n) for n = 1..1000
E. Costa, R. Gerbicz and D. Harvey, A search for Wilson primes, Math. Comp., 83 (2014), 3071-3091.
R. Crandall, K. Dilcher and C. Pomerance, A search for Wieferich and Wilson primes, Math. Comp., 66 (1997), 433-449.
MATHEMATICA
f[n_] := Block[{k = 0, m, p = Prime[n]}, m = Mod[(p - 1)!, p^2]; While[ Mod[-1 - k*p, p^2] != m, k++]; k]; Array[f, 70] (* Robert G. Wilson v, Dec 03 2014 *)
PROG
(PARI) forprime(p=1, 1e9, b=0; while(Mod((p-1)!, p^2)!=-1-b*p, b++); print1(b, ", "))
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Nov 22 2014
STATUS
approved