

A192367


Numbers k such that k! + 2*k + 1 is prime.


0




OFFSET

1,2


COMMENTS

Some of the larger entries may only correspond to probable primes.


LINKS



EXAMPLE

6! + 2*6 + 1 = 733 is prime, so 6 is in the sequence.


MAPLE

select(p > isprime(factorial(p) + 2*p + 1), [$0 .. 1000]) # Reza K Ghazi, Jul 11 2021


MATHEMATICA

Select[Range[0, 1000], PrimeQ[#! + 2*# + 1] &] (* Reza K Ghazi, Jul 11 2021 *)


PROG

(Python)
factor=1;
for i in range(2, 10000):
factor=factor*i
if is_probable_prime(factor+2*i+1): #A MillerRabin primality test, with k=10
print i
(Magma) [ n: n in [0..1000]  IsPrime(Factorial(n)+2*n+1) ]; // Klaus Brockhaus, Jul 02 2011
(PARI) for(n=0, 10^5, N=n!+2*n+1; if(ispseudoprime(N), print1(n, ", ")));
/* use isprime() for stricter checking */ /* Joerg Arndt, Jul 03 2011 */
(SageMath) [p for p in range(1000) if is_prime(factorial(p)+2*p+1)] # Reza K Ghazi, Jul 11 2021


CROSSREFS



KEYWORD

hard,nonn


AUTHOR



EXTENSIONS



STATUS

approved



