OFFSET
1,2
COMMENTS
Some of the larger entries may only correspond to probable primes.
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 Miller-Rabin 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
Julio Cesar Hernandez-Castro, Jun 29 2011
EXTENSIONS
0 added by Arkadiusz Wesolowski, Jun 29 2011
a(9) from Arkadiusz Wesolowski, Jul 02 2011
a(10) from Charles R Greathouse IV, Oct 14 2011
STATUS
approved