%I #12 Nov 13 2024 18:29:00
%S 2,2,3,2,3,3,5,2,2,13,3,2,5,3,2,7,3,5,5,3,5,2,2,11,3,3,3,5,2,13,2,3,7,
%T 13,3,7,7,5,2,2,3,2,5,13,11,29,5,19,5,2,2,3,2,3,3,13,3,3,2,3,2,13,3,3,
%U 5,3,5,3,7,7,2,3,3,11,5,67,3,7,17,2,7,2,7
%N Let p = prime(n), then a(n) is the least prime q < p such that p * q# + 1 is prime.
%C The notation q# means A034386(q).
%C Buhler, Crandall and Penk conjecture a(n) exists for all n > 1.
%H Jeppe Stig Nielsen, <a href="/A377838/b377838.txt">Table of n, a(n) for n = 2..10001</a>
%H J. P. Buhler, R. E. Crandall and M. A. Penk, <a href="https://www.ams.org/journals/mcom/1982-38-158/S0025-5718-1982-0645679-1/">Primes of the form n! ± 1 and 2 · 3 · 5 ··· p ± 1</a>, Math. Comp. 38 (1982), 639-643.
%e For a(122), consider 673, the 122nd prime. Search for primes of form 673*2*3*5*7*...*q + 1. The first such prime appears at q=509 (and 509 is less than 673). Therefore a(122) = 509.
%o (PARI) a(n)=p=prime(n);m=p;forprime(q=2,p-1,m*=q;ispseudoprime(m+1)&&return(q));error("none")
%Y Cf. A034386.
%K nonn
%O 2,1
%A _Jeppe Stig Nielsen_, Nov 09 2024