login
A283149
Largest k such that (p-1)! == -1 (mod p^k), where p = prime(n).
1
1, 1, 2, 1, 1, 2, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 2, 1, 1
OFFSET
1,3
COMMENTS
a(n) > 1 iff A002068(n) = 0, i.e., iff p is a Wilson prime (A007540).
Is a(n) < 3 for all n?
LINKS
MAPLE
f:= proc(n) local p;
p:= ithprime(n);
padic:-ordp((p-1)!+1, p)
end proc:
map(f, [$1..200]); # Robert Israel, Apr 29 2021
MATHEMATICA
Table[With[{p = Prime@ n}, SelectFirst[Reverse@ Range@ 10, Mod[(p - 1)!, #] == # - 1 &[p^#] &]], {n, 105}] (* Michael De Vlieger, Aug 20 2017 *)
PROG
(PARI) a(n) = my(p=prime(n), k=1); while(Mod((p-1)!, p^k)==-1, k++); k-1
CROSSREFS
Sequence in context: A321765 A328310 A136673 * A097588 A183017 A183014
KEYWORD
nonn
AUTHOR
Felix Fröhlich, Mar 01 2017
EXTENSIONS
More terms from Antti Karttunen, Aug 20 2017
STATUS
approved