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 A374028 #12 Jun 30 2024 09:02:38 %S A374028 11,31,41,61,181,54001,6841,54721,110017981,13681,20521,61561,123121, %T A374028 225721,246241,205201,410401,1128601,513001,3078001,4617001, %U A374028 73442619001,96993612810001,55404001,7188669001,16773561001,67094244001,821904489001,29370505311001 %N A374028 Lexicographically earliest sequence of prime numbers whose partial products, starting from the second, are all Fermat pseudoprimes to base 2 (A001567). %H A374028 Daniel Suteu, <a href="/A374028/b374028.txt">Table of n, a(n) for n = 1..43</a> %H A374028 <a href="/index/Ps#pseudoprimes">Index entries for sequences related to pseudoprimes</a>. %e A374028 The partial products begin with 11, 11 * 31 = 341 = A001567(1), 11 * 31 * 41 = 13981 = A001567(29), 11 * 31 * 41 * 61 = 852841 = A001567(234), 11 * 31 * 41 * 61 * 181 = 154364221 = A001567(2509), ... . %t A374028 pspQ[n_] := PowerMod[2, n - 1, n] == 1; a[1] = 11; a[n_] := a[n] = Module[{p = 2, r = Product[a[i], {i, 1, n - 1}]}, While[! pspQ[p*r], p = NextPrime[p]]; p]; Array[a, 10] %o A374028 (PARI) ispsp(n) = Mod(2, n)^(n-1) == 1; %o A374028 lista(len) = {my(prd = 1, c = 0, k = 11); while(c < len, while(!ispsp(prd * k), k = nextprime(k+1)); prd *= k; print1(k,", "); c++; k = 3);} %o A374028 (PARI) my(P=List(11), base=2); my(m = vecprod(Vec(P))); my(L = znorder(Mod(base, m))); print1(P[1], ", "); while(1, forstep(p=lift(1/Mod(m, L)), oo, L, if(isprime(p) && m % p != 0 && base % p != 0, if((m*p-1) % znorder(Mod(base, p)) == 0, print1(p, ", "); listput(P, p); L = lcm(L, znorder(Mod(base, p))); m *= p; break)))); \\ _Daniel Suteu_, Jun 30 2024 %Y A374028 Cf. A001567, A374027, A374029. %K A374028 nonn %O A374028 1,1 %A A374028 _Amiram Eldar_, Jun 26 2024 %E A374028 a(23)-a(29) from _Daniel Suteu_, Jun 30 2024