A374901 Numbers k such that k!^2 + ((k - 1)!^2) + 1 is prime.
1, 3, 4, 6, 10, 11, 118, 271, 288, 441, 457, 2931, 5527, 6984, 9998, 10395, 13703
Offset: 1
Examples
4 is a term, because 4!^2 + 3!^2 + 1 = 576 + 36 + 1 = 613 is a prime number.
Programs
-
PARI
is(k) = isprime((k!^2)+((k-1)!)^2+1);
-
Python
from itertools import count, islice from sympy import isprime def A374901_gen(): # generator of terms f = 1 for k in count(1): if isprime((k**2+1)*f+1): yield k f *= k**2 A374901_list = list(islice(A374901_gen(),10)) # Chai Wah Wu, Oct 02 2024
Extensions
a(12)-a(14) from Michael S. Branicky, Aug 01 2024
a(15)-a(17) from Karl-Heinz Hofmann, Aug 23 2024
Comments