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.

A181780 Numbers n which are Fermat pseudoprimes to some base b, 2 <= b <= n-2.

Original entry on oeis.org

15, 21, 25, 28, 33, 35, 39, 45, 49, 51, 52, 55, 57, 63, 65, 66, 69, 70, 75, 76, 77, 85, 87, 91, 93, 95, 99, 105, 111, 112, 115, 117, 119, 121, 123, 124, 125, 129, 130, 133, 135, 141, 143, 145, 147, 148, 153, 154, 155, 159, 161, 165, 169, 171, 172, 175, 176
Offset: 1

Views

Author

Karsten Meyer, Nov 12 2010

Keywords

Comments

A nonprime number n is a Fermat pseudoprime to base b if b^(n-1) = 1 (mod n).
It appears that these n are pseudoprimes for an even number of bases. When n is the product of two distinct primes, it appears that there are exactly two such bases x and y with x + y = n. See A211455, A211456, and A211457. - T. D. Noe, Apr 12 2012

Examples

			15 is Fermat pseudoprime to base 4 and 11, so it is a Fermat pseudoprime.
		

Crossrefs

Even terms give A039772. - Thomas Ordowski, Dec 28 2016

Programs

  • Mathematica
    t = {}; Do[s = Select[Range[2, n-2], PowerMod[#, n-1, n] == 1 &]; If[s != {}, AppendTo[t, n]], {n, Select[Range[213], ! PrimeQ[#] &]}]; t (* T. D. Noe, Nov 07 2011 *)
    (* The following program is much faster than the one above. See A227180 for indications of a proof of this assertion. *) Select[Range[213], ! IntegerQ[Log[3, #]] && ! PrimeQ[#] && GCD[# - 1, EulerPhi[#]] > 1 &] (* Emmanuel Vantieghem, Jul 06 2013 *)
  • PARI
    fsp(n)=
    { /* whether n is Fermat pseudoprime to any base a where 2<=a<=n-2 */
        for (a=2,n-2,
            if ( gcd(a,n)!=1, next() );
            if ( (Mod(a,n))^(n-1)==+1, return(1) )
        );
        return(0);
    }
    for(n=3,300, if(isprime(n),next());  if ( fsp(n) , print1(n,", ") ); );
    \\ Joerg Arndt, Jan 08 2011
    
  • PARI
    is(n)=if(isprime(n), return(0)); my(f=factor(n)[,1]); prod(i=1, #f, gcd(f[i]-1, n-1)) > 2 \\ Charles R Greathouse IV, Dec 28 2016
  • Rexx
    See Meyer link.
    

Formula

For any odd a(m), a(m) = A211456(m) + A211457(m). - Thomas Ordowski, Dec 09 2013

Extensions

Used a comment line to give a more explicit definition. - N. J. A. Sloane, Nov 12 2010
Definition corrected by Max Alekseyev, Nov 12 2010

A211455 The number of bases b for which A181780(n) is a Fermat pseudoprime.

Original entry on oeis.org

2, 2, 2, 2, 2, 2, 2, 6, 4, 2, 2, 2, 2, 2, 14, 4, 2, 2, 2, 2, 2, 14, 2, 34, 2, 2, 2, 14, 2, 2, 2, 6, 2, 8, 2, 2, 2, 2, 2, 34, 2, 2, 2, 14, 2, 2, 14, 2, 2, 2, 2, 14, 10, 2, 2, 10, 4, 2, 2, 14, 4, 2, 2, 8, 6, 2, 2, 2, 14, 2, 2, 2, 2, 2, 34, 2, 14, 6, 38, 6, 2, 2
Offset: 1

Views

Author

T. D. Noe, Apr 13 2012

Keywords

Comments

Sequences A211456 and A211457 give the smallest and largest bases b; A211458 lists all bases.
Every term in this sequence is even. - Geoffrey Critzer, Apr 08 2015

Crossrefs

Programs

  • Mathematica
    t = {}; n = 1; While[Length[t] < 100, n++; If[! PrimeQ[n], s = Select[Range[2, n-2], PowerMod[#, n-1, n] == 1 &]; If[s != {}, AppendTo[t, {n, Length[s], s}]]]]; Transpose[t][[2]]
    f[n_] := If[ PrimeQ@ n, {}, Count[ Table[ PowerMod[k, n - 1, n], {k, 2, n - 2}], 1]] /. {0 -> {}}; Array[f, 237] // Flatten (* Robert G. Wilson v, Apr 08 2015 *)

Formula

a(n) = A063994(m) - 2 for odd m in A181780. a(n) = A063994(m) - 1 for even m in A181780. - Thomas Ordowski, Dec 13 2013

A211456 Smallest base b for which A181780(n) is a Fermat pseudoprime.

Original entry on oeis.org

4, 8, 7, 9, 10, 6, 14, 8, 18, 16, 9, 21, 20, 8, 8, 25, 22, 11, 26, 45, 34, 4, 28, 3, 32, 39, 10, 8, 38, 65, 24, 8, 50, 3, 40, 5, 57, 44, 61, 8, 26, 46, 12, 12, 50, 121, 8, 23, 61, 52, 22, 23, 19, 37, 49, 24, 49, 58, 62, 6, 97, 67, 55, 11, 14, 165, 68, 57, 9
Offset: 1

Views

Author

T. D. Noe, Apr 13 2012

Keywords

Comments

That is, the smallest b for which b^(s-1) = 1 (mod s), where s is in A181780.

Crossrefs

Programs

  • Mathematica
    t = {}; n = 1; While[Length[t] < 100, n++; If[! PrimeQ[n], s = Select[Range[2, n-2], PowerMod[#, n-1, n] == 1 &]; If[s != {}, AppendTo[t, {n, Length[s], s}]]]]; First/@Transpose[t][[3]]

A211457 Largest number b for which A181780(n) is a Fermat pseudoprime.

Original entry on oeis.org

11, 13, 18, 25, 23, 29, 25, 37, 31, 35, 29, 34, 37, 55, 57, 49, 47, 51, 49, 49, 43, 81, 59, 88, 61, 56, 89, 97, 73, 81, 91, 109, 69, 118, 83, 25, 68, 85, 81, 125, 109, 95, 131, 133, 97, 137, 145, 67, 94, 107, 139, 142, 150, 134, 165, 151, 113, 119, 121, 179
Offset: 1

Views

Author

T. D. Noe, Apr 13 2012

Keywords

Comments

That is, the largest b for which b^(s-1) = 1 (mod s), where s is in A181780.

Crossrefs

Programs

  • Mathematica
    t = {}; n = 1; While[Length[t] < 100, n++; If[! PrimeQ[n], s = Select[Range[2, n-2], PowerMod[#, n-1, n] == 1 &]; If[s != {}, AppendTo[t, {n, Length[s], s}]]]]; Last/@Transpose[t][[3]]

A242742 Let k be the n-th composite number: then a(n) is the smallest base b such that b^(k-1) == 1 (mod k).

Original entry on oeis.org

5, 7, 9, 8, 11, 13, 15, 4, 17, 19, 21, 8, 23, 25, 7, 27, 26, 9, 31, 33, 10, 35, 6, 37, 39, 14, 41, 43, 45, 8, 47, 49, 18, 51, 16, 9, 55, 21, 57, 20, 59, 61, 63, 8, 65, 8, 25, 69, 22, 11, 73, 75, 26, 45, 34, 79, 81, 80, 83, 85, 4, 87, 28, 89, 91, 3, 93, 32, 95
Offset: 1

Views

Author

Felix Fröhlich, Aug 16 2014

Keywords

Crossrefs

Programs

  • Mathematica
    sbb[n_]:=Module[{b=2},While[PowerMod[b,n-1,n]!=1,b++];b]; sbb/@Select[ Range[ 100],CompositeQ] (* Requires Mathematica version 10 or later *) (* Harvey P. Dale, Dec 29 2018 *)
  • PARI
    forcomposite(k=2, 1e2, for(b=2, 1e9, if(Mod(b, k)^(k-1)==1, print1(b, ", "); next({2}))); print1(">1e9, "))

Formula

a(n) = A105222(A002808(n)). - Michel Marcus, Aug 21 2014
Showing 1-5 of 5 results.