login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
A271874 Smallest base-n Fermat pseudoprime with n distinct prime factors. 3

%I #11 Sep 02 2022 13:41:17

%S 341,286,11305,2203201,12306385,9073150801,3958035081,2539184851126,

%T 152064312120721,10963650080564545,378958695265110961,

%U 1035551157050957605345,57044715596229144811105,6149883077429715389052001,426634466310819456228926101,166532358913107245358261399361

%N Smallest base-n Fermat pseudoprime with n distinct prime factors.

%C Main diagonal of A271873.

%H Daniel Suteu, <a href="/A271874/b271874.txt">Table of n, a(n) for n = 2..27</a>

%e a(4) = 11305, since 11305 is the smallest term x of A020136 such that A001221(x) = 4.

%o (PARI) a(n) = forcomposite(c=1, , if(Mod(n, c)^(c-1)==1, if(omega(c)==n, return(c))))

%o (PARI)

%o 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 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 Cf. A001221, A020136, A271873.

%K nonn

%O 2,1

%A _Felix Fröhlich_, Apr 16 2016

%E a(7)-a(17) from _Daniel Suteu_, Sep 02 2022

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified April 24 00:30 EDT 2024. Contains 371917 sequences. (Running on oeis4.)