OFFSET
1,1
COMMENTS
For q < 7, f(q) is not an integer.
f(q) for q = 2557 is a PRP7592.
According to Wilson's theorem, f(q) can be an integer only if q is prime.
MATHEMATICA
a[q_]:=If[PrimeQ[((((q - 2)! - 1) / q) - 1) / (q + 1)], q]; DeleteCases[Array[a, 100], Null] (* Stefano Spezia, Nov 04 2018 *)
PROG
(PARI) forprime(q=7, 2557, my(p = ((((q - 2)! - 1) / q) - 1) / (q + 1)); if(ispseudoprime(p), print1(q, ", ")))
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Rashid Naimi, Sep 13 2018
STATUS
approved