Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).
%I #23 Mar 06 2024 01:00:18
%S 0,1,2,4,6,16,28,42
%N Numbers k such that k! + k^3 + 1 is prime.
%C If k is a term then k+1 is not composite (since k! + k^3 + 1 is divisible by k+1 for a composite k > 4). - _Amiram Eldar_, Sep 14 2023
%C Any further terms exceed 50000. - _Lucas A. Brown_, Mar 05 2024
%t Select[Range[0, 50], ! CompositeQ[# + 1] && PrimeQ[#! + #^3 + 1] &] (* _Amiram Eldar_, Sep 14 2023 *)
%o (Python)
%o from sympy import isprime, factorial
%o print([k for k in range(0, 43) if isprime((factorial(k)+ k**3 + 1))])
%Y Cf. A000040, A000142, A000578, A001093, A038507, A073308, A080668.
%K nonn,hard,more
%O 1,3
%A _Darío Clavijo_, Sep 14 2023