%I #20 Feb 21 2020 15:45:52
%S 39,91,121,123,289,451,533,561,703,793,1541,1561,1599,1729,1921,2821,
%T 2899,3097,3367,3751,3829,4961,5461,5729,6031,6601,7111,7201,7381,
%U 8911,9073,9881,10897,11011,11041,11121,11521,12403,12801,13073,13333,13981
%N Pseudoprimes to base 40.
%C Composite numbers n such that 40^(n - 1) == 1 (mod n). - _Michel Lagneau_, Feb 18 2012
%H T. D. Noe, <a href="/A020168/b020168.txt">Table of n, a(n) for n = 1..1000</a>
%H <a href="/index/Ps#pseudoprimes">Index entries for sequences related to pseudoprimes</a>
%t base = 40; pp40 = {}; n = 1; While[Length[pp40] < 100, n++; If[!PrimeQ[n] && PowerMod[base, n - 1, n] == 1, AppendTo[pp40, n]]]; pp40 (* _T. D. Noe_, Feb 21 2012 *)
%t searchMax = 10000; Complement[Select[Range[searchMax], PowerMod[40, # - 1, #] == 1 &], Prime[Range[PrimePi[searchMax]]]] (* _Alonso del Arte_, Feb 20 2020 *)
%Y Cf. A001567 (pseudoprimes to base 2).
%K nonn
%O 1,1
%A _David W. Wilson_