This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A359940 #12 Jan 21 2023 03:27:38 %S A359940 2,3,5,19,11,7,31,23,193,67,367,131,317,1097,241,1777,773,2819,2689, %T A359940 1381,1741,3389,631,8581,41,1553,2297,1427,17053,1493,883,619,9803, %U A359940 13331,26203,37,7681,41269,1913,27091,3079,31583,5867,22409,13367,37337,29573,6469 %N A359940 Lexicographically earliest sequence of distinct primes whose partial products lie between noncomposite numbers. %H A359940 Amiram Eldar, <a href="/A359940/b359940.txt">Table of n, a(n) for n = 1..230</a> %e A359940 2 - 1 = 1 and 2 + 1 = 3 are both noncomposite numbers. %e A359940 2*3 - 1 = 5 and 2*3 + 1 = 7 are both noncomposite numbers. %e A359940 2*3*5 - 1 = 29 and 2*3*5 + 1 = 31 are both noncomposite numbers. %p A359940 P:= {seq(ithprime(i),i=2..10^5)}: %p A359940 R:= 2: s:= 2: %p A359940 for i from 2 to 100 do %p A359940 found:= false; %p A359940 for p in P do %p A359940 if isprime(p*s-1) and isprime(p*s+1) then R:= R,p; s:= p*s; P:= P minus {p}; found:= true; break fi; %p A359940 od; %p A359940 if not found then break fi %p A359940 od: %p A359940 R; # _Robert Israel_, Jan 19 2023 %t A359940 a[1] = 2; a[n_] := a[n] = Module[{t = Table[a[k], {k, 1, n - 1}], p = 2, r}, r = Times @@ t; While[MemberQ[t, p] || ! PrimeQ[r*p - 1] || ! PrimeQ[r*p + 1], p = NextPrime[p]]; p]; Array[a, 50] %Y A359940 Cf. A008578, A014574, A083771, A167777, A290427, A359939. %K A359940 nonn %O A359940 1,1 %A A359940 _Amiram Eldar_, Jan 19 2023