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-5 of 5 results.

A298757 Numbers k with record value of the least strong pseudoprime to base k (A298756).

Original entry on oeis.org

2, 1320, 4712, 5628, 7252, 7852, 14787, 17340, 61380, 78750, 254923, 486605, 1804842, 4095086, 12772344, 42162995
Offset: 1

Views

Author

Amiram Eldar, Jan 26 2018

Keywords

Comments

The record strong pseudoprimes are 2047, 4097, 4711, 5627, 7251, 7851, 9409, 10261, 11359, 13747, 18299, 25761, 32761, 38323, 40501, 97921, ...

Crossrefs

Programs

  • Mathematica
    sppQ[n_?EvenQ, ] := False; sppQ[n?PrimeQ, ] := False; sppQ[n, b_] := Module[{ans=False},s = IntegerExponent[n-1, 2]; d = (n-1)/2^s; If[ PowerMod[b, d, n] == 1, ans=True, Do[If[PowerMod[b, d*2^r, n] == n-1, ans=True], {r, 0, s-1}]];ans]; smallestSPP[b_] := Module[ {k=3}, While[ !sppQ[k,b],k+=2];k ]; sm=0;a={};Do[s=smallestSPP[b];If[s>sm,sm=s;AppendTo[a,b]], {b,2,10^4}];a (* after Jean-François Alcover at A020229 *)
  • PARI
    lista(nn) = {my(m=0); for (n=2, nn, my(r=a298756(n)); if (r>m, m =r; print1(n, ", ")););} \\ Michel Marcus, Jan 31 2022; using pari code in A298756

Extensions

a(9)-a(16) from Jonathan Pappas, Jan 31 2022

A326614 Smallest Euler-Jacobi pseudoprime to base n.

Original entry on oeis.org

9, 561, 121, 341, 781, 217, 25, 9, 91, 9, 133, 91, 85, 15, 1687, 15, 9, 25, 9, 21, 221, 21, 169, 25, 217, 9, 121, 9, 15, 49, 15, 25, 545, 33, 9, 35, 9, 39, 133, 39, 21, 451, 21, 9, 481, 9, 65, 49, 25, 49, 25, 51, 9, 55, 9, 55, 25, 57, 15, 481, 15, 9, 529, 9, 33, 65, 33, 25, 35, 69, 9
Offset: 1

Views

Author

Richard N. Smith, Jul 14 2019

Keywords

Comments

a(n) = 9 for n == 1 or 8 mod 9 (see A056020).

Crossrefs

Cf. A047713, A048950, A090086 (least Fermat pseudoprime to base n), A298756 (least strong pseudoprime to base n).

Programs

  • Mathematica
    ejpspQ[n_,b_] := CoprimeQ[n,b] && CompositeQ[n] && Mod[b^((n - 1)/2) - JacobiSymbol[b, n], n] == 0; leastEJpsp[b_] := Module[{k=9}, While[!ejpspQ[k, b], k+=2]; k]; Array[leastEJpsp, 100] (* Amiram Eldar, Jul 15 2019 *)
  • PARI
    isok(k, n) = ((k%2==1) && (gcd(k, n)==1) && Mod(n, k)^((k-1)/2)==kronecker(n, k) && !isprime(k));
    a(n) = my(k=2); while (! isok(k, n), k++); k; \\ Michel Marcus, Jul 15 2019

A322120 a(n) is the smallest composite k such that n^(k-1) == 1 (mod (n^2-1)*k).

Original entry on oeis.org

341, 91, 91, 217, 481, 25, 65, 91, 91, 133, 133, 85, 781, 341, 91, 91, 25, 49, 671, 221, 169, 91, 553, 217, 133, 121, 361, 341, 49, 49, 25, 545, 703, 341, 403, 217, 85, 341, 121, 671, 529, 25, 703, 133, 133, 65, 481, 247, 793, 451, 671, 703, 361, 697, 403, 25
Offset: 2

Views

Author

Thomas Ordowski, Nov 27 2018

Keywords

Comments

a(n) >= A271801(n). All terms are odd and indivisible by 3.
Conjecture: if m is a composite number such that b^(m-1) == 1 (mod (b^2-1)m) for some b, then m is a strong pseudoprime to some base a in the range 2 <= a <= m-2. Thus, probably every term a(n) is in A181782.

Crossrefs

Programs

  • Mathematica
    a[n_] := Module[{k=4}, While[PrimeQ[k] || !Divisible[n^(k-1)-1, (n^2-1)k], k++]; k]; Array[a, 100, 2] (* Amiram Eldar, Nov 27 2018 *)
  • PARI
    a(n) = {forcomposite(k=1, ,if (Mod(n, (n^2-1)*k)^(k-1) == 1, return (k)););} \\ Michel Marcus, Nov 28 2018

Extensions

More terms from Amiram Eldar, Nov 27 2018

A303978 a(n) is the smallest prime p that does not divide n-1 such that (n^p-1)/(n-1) is composite, for n > 1.

Original entry on oeis.org

11, 5, 5, 5, 11, 7, 2, 3, 5, 3, 7, 11, 2, 5, 7, 13, 3, 5, 2, 7, 11, 3, 2, 5, 2, 5, 7, 3, 3, 11, 2, 5, 2, 3, 3, 5, 2, 3, 11, 7, 3, 11, 2, 3, 11, 3, 2, 5, 2, 3, 5, 3, 2, 5, 2, 5, 5, 5, 3, 11, 2, 3, 2, 3, 11, 5, 2, 5, 5, 11, 3, 11, 2, 5, 2, 7, 5, 7, 2, 3, 5, 3, 2, 11, 2, 3, 5, 5, 2
Offset: 2

Views

Author

Thomas Ordowski, May 03 2018

Keywords

Comments

Smallest prime p such that (n^p-1)/(n-1) is a pseudoprime to base n > 1.
If Schinzel's hypothesis H is true, then the sequence is unbounded.
b(n) = (n^a(n)-1)/(n-1) is a strong pseudoprime to base n > 1, but not necessarily the smallest, cf. A298756.
b(n): 2047, 121, 341, 781, 72559411, 137257, 9, 91, 11111, 133, ...
Indices n of records a(n) = 11, 13, 17, 19, 23, 29 are n = 2, 17, 4291, 32319, 128701, 2668576. - Robert Israel, May 04 2018

Examples

			The repunit (10^5-1)/9 = 11111 = 41*271 is composite, so a(10) = 5, because (10^2-1)/9 = 11 is prime and 3 divides 9.
		

Crossrefs

Cf. A298756.

Programs

  • Maple
    f:= proc(n) local p;
      p:= 2;
      while n-1 mod p = 0 or isprime((n^p-1)/(n-1)) do p:= nextprime(p) od:
      p
    end proc:
    map(p, [$2..100]); # Robert Israel, May 04 2018
  • Mathematica
    Array[Block[{p = 2}, While[Nand[CoprimeQ[# - 1, p], CompositeQ[(#^p - 1)/(# - 1)]], p = NextPrime@ p]; p] &, 89, 2] (* Michael De Vlieger, May 06 2018 *)
  • PARI
    a(n) = {forprime(p=2,,if (((n-1) % p) && !isprime((n^p-1)/(n-1)), return (p)););} \\ Michel Marcus, May 04 2018

Extensions

More terms from Michel Marcus, May 04 2018

A354689 Smallest Euler pseudoprime to base n.

Original entry on oeis.org

9, 341, 121, 341, 217, 185, 25, 9, 91, 9, 133, 65, 21, 15, 341, 15, 9, 25, 9, 21, 65, 21, 33, 25, 217, 9, 65, 9, 15, 49, 15, 25, 545, 21, 9, 35, 9, 39, 133, 39, 21, 451, 21, 9, 133, 9, 65, 49, 25, 21, 25, 51, 9, 55, 9, 33, 25, 57, 15, 341, 15, 9, 341, 9, 33, 65
Offset: 1

Views

Author

Jinyuan Wang, Jun 03 2022

Keywords

Comments

An Euler pseudoprime to the base b is a composite number k which satisfies b^((k-1)/2) == +-1 (mod k).

Crossrefs

Programs

  • PARI
    a(n) = my(m); forcomposite(k=3, oo, if(k%2 && ((m=Mod(n, k)^(k\2))==1 || m==k-1), return(k)));
    
  • Python
    from sympy import isprime
    from itertools import count
    def a(n): return next(k for k in count(3, 2) if not isprime(k) and ((r:=pow(n, (k-1)//2, k)) == 1 or r == k-1))
    print([a(n) for n in range(1, 67)]) # Michael S. Branicky, Jun 03 2022

Formula

a(n) = 9 for n == 1 or 8 (mod 9).
Showing 1-5 of 5 results.