OFFSET
3,1
COMMENTS
Since p divides (p-2)!-1, the i-th term a(i) cannot be much larger than i log i.
LINKS
Alois P. Heinz, Table of n, a(n) for n = 3..5000
EXAMPLE
For i=3, the third prime is 5, and 5 divides 3!-1.
The 7th prime is 17, and 17 divides 5!-1, so a(7)=5.
MAPLE
a:= proc(n) local k, p; p:=ithprime(n);
for k from 2 do if irem(k!, p)=1 then return k fi od
end:
seq(a(n), n=3..100); # Alois P. Heinz, Mar 23 2016
MATHEMATICA
snpd[p_]:=Module[{n=2}, While[!Divisible[n!-1, p], n++]; n]; Table[snpd[p], {p, Prime[Range[3, 70]]}] (* Harvey P. Dale, Jun 06 2017 *)
CROSSREFS
KEYWORD
nonn,look
AUTHOR
Peter Shor, Mar 22 2016
EXTENSIONS
More terms from Alois P. Heinz, Mar 23 2016
STATUS
approved