Reminder: The OEIS is hiring a new managing editor, and the application deadline is January 26.
%I #25 Jul 23 2024 21:10:19
%S 3,11,13,17,47,101,89,97,127,439,373,257,313,1013,1277,1669,1433,1733,
%T 5011,3181,8623,8461,13697,11633,16223,16903,30677
%N Least prime p such that there exist exactly n primes of the form q#-p (q# = product of primes <= q, namely primorial numbers (second definition)).
%C n=1: {3}# - 3 is a prime.
%C n=2: {5,7}# - 11 are primes.
%C n=3: {5,7,11}# - 13 are primes.
%C n=4: {5,7,11,13}# - 17 are primes.
%C n=5: {7,13,17,19,41}# - 47 are primes.
%C n=6: {7,23,29,67,79,89}# - 101 are primes.
%C n=7: {11,31,41,43,53,61,83}# - 89 are primes.
%C n=8: {7,11,19,23,31,47,73,89}# - 97 are primes.
%C n=9: {7,17,19,23,31,53,67,71,79}# - 127 are primes.
%C n=10: {11,19,23,31,37,113,163,167,229,419}# - 439 are primes.
%C a(30)=27583 because for n=30, {13,19,31,53,61,79,101,103,137,149,157,367,383,433,499,577,701,733,2083,2467,3041,4357,6793,7243,7717,9769,11789,13331,18661,25561}# - 27583 are primes.
%e a(5) = 47 because there exist exactly 5 primes q {7,13,17,19,41} such that q# - 47 is a positive prime, and there is no prime p < 47 for which there are exactly 5 primes q such that q# - p is a positive prime.
%t v = FoldList[Times, Prime[Range[100]]];
%t t[n_] :=
%t Module[{m = 0, s = {}},
%t For[k = 1, k <= n, k++, w = v[[k]] - Prime@n;
%t If[w > 0 && PrimeQ[w], m++;
%t AppendTo[s, Prime@k]];]; {m, Prime@n, s}];
%t b = Table[t[p], {p, 100}];
%t Table[SelectFirst[b, #[[1]] == n &][[2]], {n, 12}]
%o (PARI) pp(k) = vecprod(primes([1,prime(k)]));
%o isok(p, n) = vecsum(vector(p-1, k, ispseudoprime(pp(k)-p))) == n;
%o a(n) = my(p=2); while (!isok(p, n), p = nextprime(p+1)); p; \\ _Michel Marcus_, Jul 03 2024
%Y Cf. A034386, A373631, A373661.
%K nonn,more
%O 1,1
%A _Zhining Yang_, Jun 15 2024