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.

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

Original entry on oeis.org

341, 561, 91, 11305, 286, 15, 825265, 41041, 435, 124, 45593065, 825265, 11305, 561, 35, 370851481, 130027051, 418285, 41041, 1105, 6, 38504389105, 2531091745, 30534805, 2203201, 25585, 561, 21, 7550611589521, 38504389105, 370851481, 68800501, 682465, 62745, 105, 28
Offset: 2

Views

Author

Felix Fröhlich, Apr 16 2016

Keywords

Examples

			The array A(n, k) starts as follows:
   k  =  2    3     4        5         6
n = 2: 341  561 11305   825265  45593065
n = 3:  91  286 41041   825265 130027051
n = 4:  15  435 11305   418285  30534805
n = 5: 124  561 41041  2203201  68800501
n = 6:  35 1105 25585   682465  12306385
		

Crossrefs

Cf. A007011 (row n=2), A271874.

Programs

  • PARI
    minpsp(n, k) = forcomposite(c=1, , if(Mod(n, c)^(c-1)==1, if(omega(c)==k, return(c))))
    a(n, k) = for(x=2, n, for(y=2, k, print1(minpsp(x, y), ", ")); print(""))
    a(6, 6) \\ print array up to n = 6, k = 6
    
  • PARI
    fermat_psp(A, B, k, base) = A=max(A, vecprod(primes(k))); (f(m, l, lo, k) = 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, 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; 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)); q *= p; Mod(base, q)^z == 1 || break; v *= p))); list); vecsort(Set(f(1, 1, 2, k)));
    T(n,k) = if(n < 2, return()); my(x=vecprod(primes(k)), y=2*x); while(1, my(v=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)", "))); \\ Daniel Suteu, Dec 01 2023

Extensions

a(16)-a(37) from Daniel Suteu, Sep 02 2022

A361256 Smallest base-n strong Fermat pseudoprime with n distinct prime factors.

Original entry on oeis.org

2047, 8911, 129921, 381347461, 333515107081, 37388680793101, 713808066913201, 665242007427361, 179042026797485691841, 8915864307267517099501, 331537694571170093744101, 2359851544225139066759651401, 17890806687914532842449765082011
Offset: 2

Views

Author

Daniel Suteu, Mar 06 2023

Keywords

Comments

Main diagonal of A360184.

Crossrefs

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));
    a(n) = if(n < 2, return()); my(x=vecprod(primes(n)), y=2*x); while(1, my(v=strong_fermat_psp(x, y, n, n)); if(#v >= 1, return(v[1])); x=y+1; y=2*x);
Showing 1-2 of 2 results.