cp's OEIS Frontend

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.

A271874 Smallest base-n Fermat pseudoprime with n distinct prime factors.

This page as a plain text file.
%I A271874 #11 Sep 02 2022 13:41:17
%S A271874 341,286,11305,2203201,12306385,9073150801,3958035081,2539184851126,
%T A271874 152064312120721,10963650080564545,378958695265110961,
%U A271874 1035551157050957605345,57044715596229144811105,6149883077429715389052001,426634466310819456228926101,166532358913107245358261399361
%N A271874 Smallest base-n Fermat pseudoprime with n distinct prime factors.
%C A271874 Main diagonal of A271873.
%H A271874 Daniel Suteu, <a href="/A271874/b271874.txt">Table of n, a(n) for n = 2..27</a>
%e A271874 a(4) = 11305, since 11305 is the smallest term x of A020136 such that A001221(x) = 4.
%o A271874 (PARI) a(n) = forcomposite(c=1, , if(Mod(n, c)^(c-1)==1, if(omega(c)==n, return(c))))
%o A271874 (PARI)
%o A271874 fermat_psp(A, B, k, base) = A=max(A, vecprod(primes(k))); (f(m, l, p, j) = my(list=List()); forprime(q=p, sqrtnint(B\m, j), if(base%q != 0, my(v=m*q, t=q, r=nextprime(q+1)); while(v <= B, my(L=lcm(l, znorder(Mod(base, t)))); if(gcd(L, v) == 1, if(j==1, if(v>=A && if(k==1, !isprime(v), 1) && (v-1)%L == 0, listput(list, v)), if(v*r <= B, list=concat(list, f(v, L, r, j-1)))), break); v *= q; t *= q))); list); vecsort(Vec(f(1, 1, 2, k)));
%o A271874 a(n) = if(n < 2, return()); my(x=vecprod(primes(n)), y=2*x); while(1, my(v=fermat_psp(x, y, n, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x); \\ _Daniel Suteu_, Sep 02 2022
%Y A271874 Cf. A001221, A020136, A271873.
%K A271874 nonn
%O A271874 2,1
%A A271874 _Felix Fröhlich_, Apr 16 2016
%E A271874 a(7)-a(17) from _Daniel Suteu_, Sep 02 2022