OFFSET
1,1
LINKS
EXAMPLE
MATHEMATICA
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]
PROG
(PARI) ispsp(n) = Mod(2, n)^(n-1) == 1;
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); }
(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
CROSSREFS
KEYWORD
nonn
AUTHOR
Amiram Eldar, Jun 26 2024
EXTENSIONS
a(21)-a(28) from Daniel Suteu, Jun 30 2024
STATUS
approved