login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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 (list; graph; refs; listen; history; text; internal format)
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

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 25 04:42 EDT 2024. Contains 371964 sequences. (Running on oeis4.)