login
A373661
Least prime p such that there exist exactly n primes of the form k!-p.
1
3, 7, 23, 11, 13, 31, 43, 17, 61, 79, 103, 113, 89, 197, 163, 509, 571, 409, 929, 617, 1999, 367, 1583, 1531, 659, 7669, 7321, 7919, 7907, 11783
OFFSET
1,1
EXAMPLE
a(4) = 11 because there exist exactly 4 integers k {4, 5, 6, 10} such that k! - 11 is a positive prime, and there is no prime p < 11 for which there are exactly 4 integers k such that k! - p is a positive prime.
MATHEMATICA
t[n_] :=
Module[{m = 0, s = {}},
For[k = 3, k <= n, k++, If[k! > n && PrimeQ[k! - n],
AppendTo[s, k]; m++]]; {m, n, s}];
b = Table[t[p], {p, Prime@Range@50}]; Table[SelectFirst[b, #[[1]] == n &][[2]], {n, 15}]
PROG
(PARI) isok(p, n) = vecsum(vector(p-1, k, ispseudoprime(k!-p))) == n;
a(n) = my(p=2); while (!isok(p, n), p = nextprime(p+1)); p; \\ Michel Marcus, Jul 02 2024
CROSSREFS
Sequence in context: A229438 A069505 A363544 * A355075 A173878 A225264
KEYWORD
nonn,more
AUTHOR
Zhining Yang, Jun 12 2024
STATUS
approved