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

A096985
Numbers k such that k*k! - NextPrime(k) is prime.
1
3, 5, 8, 10, 12, 13, 23, 26, 30, 33, 38, 114, 162, 219, 265, 268, 277, 344, 463, 651, 877, 1128, 2466, 2594, 4828, 6512
OFFSET
1,1
COMMENTS
For a(23), the corresponding value of k*k! - NextPrime(k) has more than 6239 digits.
EXAMPLE
3 is in the sequence because 3*3! - 5 = 13 is prime.
8 is in the sequence because 8*8! - 11 = 322549 is prime.
MATHEMATICA
<< NumberTheory`NumberTheoryFunctions`; v={}; Do[If[PrimeQ [n*n!-NextPrime[n]], v=Append[v, n]; Print[v]], {n, 2150}]
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 *)
CROSSREFS
KEYWORD
nonn,hard,more
AUTHOR
Farideh Firoozbakht, Jul 31 2004
EXTENSIONS
a(23)-a(24) from Ryan Propper, Jan 01 2008
a(25)-a(26) from Michael S. Branicky, Aug 21 2023
STATUS
approved