login
Numbers k such that k!^2 + ((k - 1)!^2) + 1 is prime.
1

%I #33 Oct 03 2024 03:54:36

%S 1,3,4,6,10,11,118,271,288,441,457,2931,5527,6984,9998,10395,13703

%N Numbers k such that k!^2 + ((k - 1)!^2) + 1 is prime.

%C a(18) > 15000 - _Karl-Heinz Hofmann_, Aug 23 2024

%e 4 is a term, because 4!^2 + 3!^2 + 1 = 576 + 36 + 1 = 613 is a prime number.

%o (PARI) is(k) = isprime((k!^2)+((k-1)!)^2+1);

%o (Python)

%o from itertools import count, islice

%o from sympy import isprime

%o def A374901_gen(): # generator of terms

%o f = 1

%o for k in count(1):

%o if isprime((k**2+1)*f+1):

%o yield k

%o f *= k**2

%o A374901_list = list(islice(A374901_gen(),10)) # _Chai Wah Wu_, Oct 02 2024

%Y Cf. A000142, A055490, A358805, A358878, A359180, A080778, A243078, A242994

%K nonn,more

%O 1,2

%A _Arsen Vardanyan_, Jul 31 2024

%E a(12)-a(14) from _Michael S. Branicky_, Aug 01 2024

%E a(15)-a(17) from _Karl-Heinz Hofmann_, Aug 23 2024