A035093 Smallest k such that k*n! + 1 is prime.
1, 1, 1, 3, 2, 3, 3, 4, 3, 3, 1, 2, 3, 13, 7, 4, 5, 2, 7, 17, 15, 18, 3, 6, 3, 16, 1, 4, 7, 20, 8, 3, 9, 5, 2, 7, 1, 3, 10, 3, 1, 29, 7, 9, 45, 8, 3, 6, 35, 66, 2, 20, 2, 4, 25, 52, 14, 34, 24, 6, 10, 22, 38, 16, 20, 91, 69, 12, 19, 20, 21, 42, 1, 5, 33, 77, 1, 2, 12, 29, 193, 74, 40, 55, 19
Offset: 1
Keywords
Examples
a(7)=3 because in progression of 5040*k+1 the terms 5041 and 10081 are not prime and so 15121 is the first prime.
Programs
-
Mathematica
Table[k = 1; While[! PrimeQ[1 + k*n!], k++]; k, {n, 85}] (* T. D. Noe, Nov 04 2013 *)
-
PARI
a(n) = my(k=1); while(!isprime(k*n!+1), k++); k; \\ Michel Marcus, Sep 26 2020
Extensions
a(80) corrected by Alex Ratushnyak, Nov 03 2013
Simpler title by Sean A. Irvine, Sep 25 2020
Comments