%I
%S 3,2,5,13,7,11,19,43,79,31,17,71,89,23,41,67,29,73,83,107,59,53,239,
%T 101,109,233,61,197,97,103,37,211,113,157,167,131,181,179,269,127,421,
%U 47,523,173,331,307,149,347,257,199,277,139,151,433,223,449,227,313,647,443,283,929,509
%N Rearrangement of primes such that every partial product minus 1 is a prime.
%C Records: 3, 5, 13, 19, 43, 79, 89, 107, 239, 269, 421, 523, 647, 929, 1069, 1321, 1783, 1879, 2347, 4217, 4801, 7001, 7691, 9623, 22769, 23011, 27541, 29009, ..., .
%C Position of the n_th prime: 2, 1, 3, 5, 6, 4, 11, 7, 14, 17, 10, 31, 15, 8, 42, 22, 21, 27, 16, 12, 18, 9, ..., .
%C Prime index of a(n): 2, 1, 3, 6, 4, 5, 8, 14, 22, 11, 7, 20, 24, 9, 13, 19, 10, 21, 23, 28, 17, 16, 52, 26, 29, 51, ..., .
%H Robert G. Wilson v, <a href="/A290427/b290427.txt">Table of n, a(n) for n = 1..1000</a>
%F 3*2*5*...*a(n) 1 is prime. a(n) is the least prime not previously in the sequence.
%t f[s_List] := Block[{p = Times @@ s, q = 2}, While[ MemberQ[s, q]  !PrimeQ[p*q  1], q = NextPrime@ q]; Append[s, q]]; Nest[f, {3}, 40]
%Y Cf. A000040, A087898, A083771.
%K nonn
%O 1,1
%A _Robert G. Wilson v_, Jul 31 2017
