cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

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

This page as a plain text file.
%I A192367 #47 May 06 2025 07:15:20
%S A192367 0,2,3,5,6,18,44,113,2615,16914
%N A192367 Numbers k such that k! + 2*k + 1 is prime.
%C A192367 Some of the larger entries may only correspond to probable primes.
%C A192367 a(11) > 30000. - _Michael S. Branicky_, Apr 20 2025
%e A192367 6! + 2*6 + 1 = 733 is prime, so 6 is in the sequence.
%p A192367 select(p -> isprime(factorial(p) + 2*p + 1), [$0 .. 1000]) # _Reza K Ghazi_, Jul 11 2021
%t A192367 Select[Range[0, 1000], PrimeQ[#! + 2*# + 1] &] (* _Reza K Ghazi_, Jul 11 2021 *)
%o A192367 (Python)
%o A192367 from sympy import isprime
%o A192367 factor = 1;
%o A192367 for i in range(0, 10000):
%o A192367     if i < 2:
%o A192367         factor = 1
%o A192367     else:
%o A192367         factor = factor*i
%o A192367     if isprime(factor + 2*i + 1):
%o A192367         print(i, end=', ')
%o A192367 (Magma) [ n: n in [0..1000] | IsPrime(Factorial(n)+2*n+1) ]; // _Klaus Brockhaus_, Jul 02 2011
%o A192367 (PARI) for(n=0,10^5,N=n!+2*n+1;if(ispseudoprime(N),print1(n,", ")));
%o A192367 /* use isprime() for stricter checking */ /* _Joerg Arndt_, Jul 03 2011 */
%o A192367 (SageMath) [p for p in range(1000) if is_prime(factorial(p)+2*p+1)] # _Reza K Ghazi_, Jul 11 2021
%Y A192367 Cf. A073308 (k!+k+1 is prime).
%K A192367 nonn,hard,more
%O A192367 1,2
%A A192367 _Julio Cesar Hernandez-Castro_, Jun 29 2011
%E A192367 0 added by _Arkadiusz Wesolowski_, Jun 29 2011
%E A192367 a(9) from _Arkadiusz Wesolowski_, Jul 02 2011
%E A192367 a(10) from _Charles R Greathouse IV_, Oct 14 2011