login
A250406
Values of B such that p = prime(n) satisfies (p-1)! == -1-B*p (mod p^2), i.e., p is a near-Wilson prime.
8
1, 2, 0, 2, 10, 0, 12, 17, 15, 11, 12, 30, 25, 30, 41, 19, 32, 5, 55, 2, 62, 6, 63, 19, 27, 29, 46, 106, 79, 18, 56, 12, 81, 72, 55, 65, 6, 55, 146, 67, 131, 109, 32, 158, 50, 81, 38, 43, 114, 98, 64, 132, 45, 37, 80, 190, 148, 101, 252, 4, 119, 62, 36, 52, 25
OFFSET
1,2
COMMENTS
p is in A007540 iff a(n) == 0.
LINKS
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