%I #22 Mar 22 2018 09:43:39
%S 0,3,7,9,67,291,1343,6984,12861
%N Numbers k such that k!+(k+1)!+1 is prime.
%C 291 is in the sequence and also is in the sequence A087146, thus (291!+292!-1,291!+292!+1) is a twin pair of primes. Any additional terms are greater than 1800 with the next prime having more than 5086 digits.
%C Next term is greater than 4200. - Gabriel Cunningham (gcasey(AT)mit.edu), Sep 09 2003
%C a(10) > 25000. - _Robert Price_, Aug 26 2015
%C k+1 is not prime because (p-1)! + p! + 1 == 0 mod p and (p-1)! + p! + 1 > p where p is prime. - _Seiichi Manyama_, Mar 22 2018
%D H. Dubner, Factorial and primorial primes, J. Rec. Math., 19 (No.3, 1987)
%H Eric Weisstein's World of Mathematics, <a href="http://mathworld.wolfram.com/WilsonsTheorem.html">Wilson's Theorem</a>
%e 3 is in the sequence because 3!+4!+1=31 is prime.
%t v={}; Do[If[PrimeQ[n!+(n+1)!+1], v=Append[v, n]; Print[v]], {n, 1800}]; v
%t Select[Range[0,25000],PrimeQ[#!+(#+1)!+1]&] (* _Robert Price_, Aug 26 2015 *)
%o (PARI) isok(k) = ispseudoprime(k!+(k+1)!+1); \\ _Altug Alkan_, Mar 22 2018
%Y Cf. A087146, A051856.
%Y Primes in A118913. [From _Dmitry Kamenetsky_, Oct 21 2008]
%K more,nonn
%O 1,2
%A _Farideh Firoozbakht_, Aug 19 2003
%E a(8)-a(9) from _Robert Price_, Aug 26 2015