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.

A178958 Numbers n from A181780 that are not in A181781.

This page as a plain text file.
%I A178958 #13 Mar 30 2012 18:38:31
%S A178958 15,28,35,39,51,52,55,63,66,70,75,76,87,95,99,111,112,115,119,123,124,
%T A178958 130,135,143,147,148,154,155,159,171,172,176,183,186,187,190,195,196,
%U A178958 203,207,208,215,219,232,235,238,244,246,255,267,268,275,276,279,280,286,287,291,292,295,299
%N A178958 Numbers n from A181780 that are not in A181781.
%C A178958 Numbers that are Fermat pseudoprimes to some base a (2<=a<=n-2) not Euler pseudoprimes to any base a (2<=a<=n-2).
%e A178958 4^(15-1) == 1 (mod 15), but 4^((15-1)/2) == 4 (mod 15)
%o A178958 (PARI)
%o A178958 fsp(n)=
%o A178958 { /* whether n is Fermat pseudoprime to any base a where 2<=a<=n-2 */
%o A178958     for (a=2,n-2,
%o A178958         if ( gcd(a,n)!=1, next() );
%o A178958         if ( (Mod(a,n))^(n-1)==+1, return(1) )
%o A178958     );
%o A178958     return(0);
%o A178958 }
%o A178958 esp(n)=
%o A178958 { /* whether n is Euler pseudoprime to any base a where 2<=a<=n-2 */
%o A178958     local(w);
%o A178958     if ( n%2==0, return(0) );
%o A178958     for (a=2,n-2,
%o A178958         if ( gcd(a,n)!=1, next() );
%o A178958         w = abs(component((Mod(a,n))^((n-1)/2),2));
%o A178958         if ( (w==1) || (w==n-1), return(1) )
%o A178958     );
%o A178958     return(0);
%o A178958 }
%o A178958 for(n=3,300, if(isprime(n),next()); if( fsp(n) && (!esp(n)) , print1(n,", ") ); );
%Y A178958 A181780
%K A178958 nonn
%O A178958 1,1
%A A178958 _Karsten Meyer_, Dec 31 2010