OFFSET
1,4
COMMENTS
Conjecture: 0 < a(n) < sqrt(n)*(log n) for all n > 2.
See also the conjecture in A231516.
LINKS
Zhi-Wei Sun, Table of n, a(n) for n = 1..10000
EXAMPLE
a(4) = 2 since 1!*3 + 1 = 4 is not prime, but 2!*2 + 1 = 5 is prime.
MATHEMATICA
Do[Do[If[PrimeQ[x!*(n-x)+1], Print[n, " ", x]; Goto[aa]], {x, 1, n-1}];
Print[n, " ", 0]; Label[aa]; Continue, {n, 1, 100}]
lpik[n_]:=Module[{k=1}, While[!PrimeQ[k!(n-k)+1], k++]; k]; Join[{0}, Array[ lpik, 100, 2]] (* Harvey P. Dale, Apr 19 2019 *)
CROSSREFS
KEYWORD
nonn
AUTHOR
Zhi-Wei Sun, Nov 11 2013
STATUS
approved