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.

Showing 1-2 of 2 results.

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

Original entry on oeis.org

341, 286, 11305, 2203201, 12306385, 9073150801, 3958035081, 2539184851126, 152064312120721, 10963650080564545, 378958695265110961, 1035551157050957605345, 57044715596229144811105, 6149883077429715389052001, 426634466310819456228926101, 166532358913107245358261399361
Offset: 2

Views

Author

Felix Fröhlich, Apr 16 2016

Keywords

Comments

Main diagonal of A271873.

Examples

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

Crossrefs

Programs

  • PARI
    a(n) = forcomposite(c=1, , if(Mod(n, c)^(c-1)==1, if(omega(c)==n, return(c))))
    
  • PARI
    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)));
    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

Extensions

a(7)-a(17) from Daniel Suteu, Sep 02 2022

A360184 Square array A(n, k) read by antidiagonals downwards: smallest base-n strong Fermat pseudoprime with k distinct prime factors for k, n >= 2.

Original entry on oeis.org

2047, 15841, 703, 800605, 8911, 341, 293609485, 152551, 4371, 781, 10761055201, 41341321, 129921, 24211, 217, 5478598723585, 12283706701, 9224391, 4382191, 29341, 325, 713808066913201, 1064404682551, 2592053871, 381347461, 3405961, 58825, 65, 90614118359482705
Offset: 2

Views

Author

Daniel Suteu, Mar 04 2023

Keywords

Comments

The array A(n, k) starts as follows:
k = 2 3 4 5 6
n = 2: 2047 15841 800605 293609485 10761055201
n = 3: 703 8911 152551 41341321 12283706701
n = 4: 341 4371 129921 9224391 2592053871
n = 5: 781 24211 4382191 381347461 9075517561
n = 6: 217 29341 3405961 557795161 333515107081

Crossrefs

Cf. A001262, A180065 (row n=2), A271873.

Programs

  • PARI
    strong_check(p, base, e, r) = my(tv=valuation(p-1, 2)); tv > e && Mod(base, p)^((p-1)>>(tv-e)) == r;
    strong_fermat_psp(A, B, k, base) = A=max(A, vecprod(primes(k))); (f(m, l, lo, k, e, r) = my(list=List()); my(hi=sqrtnint(B\m, k)); if(lo > hi, return(list)); if(k==1, forstep(p=lift(1/Mod(m, l)), hi, l, if(isprimepower(p) && gcd(m*base, p) == 1 && strong_check(p, base, e, r), my(n=m*p); if(n >= A && (n-1) % znorder(Mod(base, p)) == 0, listput(list, n)))), forprime(p=lo, hi, base%p == 0 && next; strong_check(p, base, e, r) || next; my(z=znorder(Mod(base, p))); gcd(m,z) == 1 || next; my(q=p, v=m*p); while(v <= B, list=concat(list, f(v, lcm(l, z), p+1, k-1, e, r)); q *= p; Mod(base, q)^z == 1 || break; v *= p))); list); my(res=f(1, 1, 2, k, 0, 1)); for(v=0, logint(B, 2), res=concat(res, f(1, 1, 2, k, v, -1))); vecsort(Set(res));
    T(n, k) = if(n < 2, return()); my(x=vecprod(primes(k)), y=2*x); while(1, my(v=strong_fermat_psp(x, y, k, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x);
    print_table(n, k) = for(x=2, n, for(y=2, k, print1(T(x, y), ", ")); print(""));
    for(k=2, 9, for(n=2, k, print1(T(n, k-n+2)", ")));
Showing 1-2 of 2 results.