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”).
%I #10 Sep 11 2021 10:47:34
%S 2,2,2,2,3,3,2,2,13,3,13,2,3,11,7,37,151,11,113,2,5,2,401,73,7,109,3,
%T 7,101,2,11,109,5,277,11,7,31,89,191,31,11,2713,11,13,73,461,17,17,5,
%U 41,257,17,127,1307,53,71,281,829,139,269,137,7,41,19,107,89
%N a(n) is the least prime p such that prime(n)# * p# - 1 is prime.
%e 2*2-1 = 3 is prime, 2 = p(1)#, so a(1) = 2.
%e 2*3*2-1 = 11 is prime, 2*3 = p(2)#, so a(2) = 2.
%e 2*3*5*2-1 = 59 is prime, 2*3*5 = p(3)#, so a(3) = 2.
%e 2*3*5*7*2-1 = 419 is prime, 2*3*5*7 = p(4)#, so a(4) = 2.
%e 2*3*5*7*11*2*3-1 = 13859 is prime, 2*3*5*7*11 = p(5)#, so a(5) = 3.
%t pr[n_] := Product[Prime[i], {i,1,n}]; a[n_] := Module[{prn = pr[n], k = 1}, While[!PrimeQ[prn*pr[k] - 1], k++]; Prime[k]]; Array[a, 50] (* _Amiram Eldar_, Sep 11 2021 *)
%o (PARI) pr(p) = my(pr=1); forprime(q=2, p, pr *= q); pr;
%o a(n) = my(p=2, P=pr(prime(n))); while (!ispseudoprime(P*pr(p)-1), p = nextprime(p+1)); p; \\ _Michel Marcus_, Sep 11 2021
%Y Cf. A002110.
%K nonn
%O 1,1
%A _Pierre CAMI_, May 15 2006
%E More terms from _Amiram Eldar_, Sep 11 2021