login
Primes of the form k! - Sum_{i=1..k-1} (-1)^(k-i)*i!.
1

%I #14 Mar 31 2023 06:41:26

%S 3,7,29,139,821,5659,44741,515616581,1389068025019,

%T 2390389721955353653838200398484730341485707553165512827613149996957838364422981

%N Primes of the form k! - Sum_{i=1..k-1} (-1)^(k-i)*i!.

%C Primes of the form k! + A005165(k - 1).

%e 139 is in the sequence because it is 5! + (4! - 3! + 2! - 1!).

%o (PARI) \\ here b(n) is n! + A005165(n-1).

%o b(n) = {n! - sum(i=1, n-1, (-1)^(n-i)*i!)}

%o { for(k=1, 150, if(ispseudoprime(b(k)), print1(b(k), ", "))) } \\ _Andrew Howroyd_, Mar 12 2023

%Y Cf. A005165 (alternating factorials), A071828, A361437 (the k's).

%K hard,nonn

%O 1,1

%A _Jack Braxton_, Mar 11 2023