A075758 Smallest k such that n!+k!-1 is prime, or 0 if no such k exists.
2, 1, 2, 3, 5, 4, 7, 4, 4, 6, 2, 8, 14, 8, 8, 4, 17, 7, 26, 7, 6, 12, 6, 14, 14, 16, 2, 27, 6, 33, 6, 36, 26, 7, 33, 18, 2, 18, 6, 36, 2, 18, 14, 20, 25, 14, 25, 0, 22, 24, 34, 16, 46, 61, 18, 7, 25, 38, 47, 47, 54, 79, 157, 97, 28, 23, 7, 137, 24, 46, 36, 25, 2, 214, 94, 40, 2, 96
Offset: 1
Keywords
Examples
4!=24, 1!=1 but 24+1-1=24 is not prime. 24+2!-1=25, not prime 24+3!-1=29, prime, so a[4]=3
Programs
-
Mathematica
a = {}; Do[k = 1; While[ ! PrimeQ[n! + k! - 1], k++ ]; a = Append[a, k], {n, 1, 47}]
-
PARI
for (a=1,100,c=0; for (b=1,200, if (isprime(a!+b!-1),c=b; break)); if (c>0,print1(c,","),print1("0,")))
Extensions
Edited by Ralf Stephan, Jun 01 2005
Comments