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 A374027 #13 Jun 30 2024 06:33:55 %S A374027 341,41,61,181,721,3061,6121,9181,27541,36721,91801,100981,238681, %T A374027 21242521,67665781,477361,48690721,7160401,76377601,35802001, %U A374027 83394792001,7500519001,60004152001,3420236664001,1380095496001,13110907212001,56583915336001,128003857254001 %N A374027 Lexicographically earliest sequence of numbers whose partial products are all Fermat pseudoprimes to base 2 (A001567). %H A374027 Daniel Suteu, <a href="/A374027/b374027.txt">Table of n, a(n) for n = 1..47</a> %H A374027 <a href="/index/Ps#pseudoprimes">Index entries for sequences related to pseudoprimes</a>. %e A374027 The partial products begin with 341 = A001567(1), 341 * 41 = 13981 = A001567(29), 341 * 41 * 61 = 852841 = A001567(234), 341 * 41 * 61 * 181 = 154364221 = A001567(2509), ... . %t A374027 pspQ[n_] := PowerMod[2, n - 1, n] == 1; a[1] = 341; a[n_] := a[n] = Module[{k = 3, r = Product[a[i], {i, 1, n - 1}]}, While[!pspQ[k*r], k+=2]; k]; Array[a, 8] %o A374027 (PARI) ispsp(n) = Mod(2, n)^(n-1) == 1; %o A374027 lista(len) = {my(prd = 1, c = 0, k = 341); while(c < len, while(!ispsp(prd * k), k += 2); prd *= k; print1(k,", "); c++; k = 3);} %o A374027 (PARI) my(S=List(341),base=2); my(m = vecprod(Vec(S))); my(L = znorder(Mod(base, m))); print1(S[1], ", "); while(1, forstep(k=lift(1/Mod(m, L)), oo, L, if(gcd(m,k) == 1 && k > 1 && base % k != 0, if((m*k-1) % znorder(Mod(base, k)) == 0, print1(k, ", "); listput(S, k); L = lcm(L, znorder(Mod(base, k))); m *= k; break)))); \\ _Daniel Suteu_, Jun 30 2024 %Y A374027 Cf. A001567, A374028, A374029. %K A374027 nonn %O A374027 1,1 %A A374027 _Amiram Eldar_, Jun 26 2024 %E A374027 a(21)-a(28) from _Daniel Suteu_, Jun 30 2024