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.

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

A111305 Composite numbers k such that a^(k-1) == 1 (mod k) only when a == 1 (mod k).

Original entry on oeis.org

4, 6, 8, 10, 12, 14, 16, 18, 20, 22, 24, 26, 30, 32, 34, 36, 38, 40, 42, 44, 46, 48, 50, 54, 56, 58, 60, 62, 64, 68, 72, 74, 78, 80, 82, 84, 86, 88, 90, 92, 94, 96, 98, 100, 102, 104, 106, 108, 110, 114, 116, 118, 120, 122, 126, 128, 132, 134, 136, 138, 140, 142, 144
Offset: 1

Views

Author

Karsten Meyer, Nov 02 2005

Keywords

Comments

These unCarmichael numbers fail the Fermat primality test as often as possible.
All such numbers are even: for odd n, (-1)^(n-1) = 1.
The even numbers not in this sequence are 2 and A039772.
If c is a Carmichael number, then 2c is in the sequence. Also, the sequence is A209211 without the first two terms. - Emmanuel Vantieghem, Jul 03 2013

Examples

			10 is a term because 3^9 == 3 (mod 10), 7^9 == 7 (mod 10), 9^9 == 9 (mod 10).
		

Crossrefs

Programs

  • Mathematica
    Select[Range[4, 144],Count[Table[PowerMod[b, # - 1, #], {b, 1, # - 1}], 1] == 1 &] (* Geoffrey Critzer, Apr 11 2015 *)
  • PARI
    is(n)=for(a=2,n-1, if(Mod(a,n)^(n-1)==1, return(0))); !isprime(n) \\ Charles R Greathouse IV, Dec 22 2016

Extensions

Edited by Don Reble, May 16 2006
Showing 1-2 of 2 results.