login

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”).

Numbers k such that k*k! - NextPrime(k) is prime.
1

%I #24 Aug 23 2023 08:37:14

%S 3,5,8,10,12,13,23,26,30,33,38,114,162,219,265,268,277,344,463,651,

%T 877,1128,2466,2594,4828,6512

%N Numbers k such that k*k! - NextPrime(k) is prime.

%C For a(23), the corresponding value of k*k! - NextPrime(k) has more than 6239 digits.

%e 3 is in the sequence because 3*3! - 5 = 13 is prime.

%e 8 is in the sequence because 8*8! - 11 = 322549 is prime.

%t << NumberTheory`NumberTheoryFunctions`;v={};Do[If[PrimeQ [n*n!-NextPrime[n]], v=Append[v, n];Print[v]], {n, 2150}]

%t Select[Range[900],PrimeQ[# #!-NextPrime[#]]&] (* The program generates the first 21 terms of the sequence. To select more, increase the Range constant but the program may take a long time to run. *) (* _Harvey P. Dale_, Aug 16 2023 *)

%Y Cf. A096986, A090704, A049433.

%K nonn,hard,more

%O 1,1

%A _Farideh Firoozbakht_, Jul 31 2004

%E a(23)-a(24) from _Ryan Propper_, Jan 01 2008

%E a(25)-a(26) from _Michael S. Branicky_, Aug 21 2023