login
A192367
Numbers k such that k! + 2*k + 1 is prime.
0
0, 2, 3, 5, 6, 18, 44, 113, 2615, 16914
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
Cf. A073308 (k!+k+1 is prime).
Sequence in context: A293027 A276353 A109628 * A227230 A102977 A238335
KEYWORD
hard,nonn
AUTHOR
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