%I #14 Aug 10 2018 17:37:51
%S 39,121,289,451,703,1561,1921,4961,5729,6601,7111,7201,10897,11041,
%T 12403,13333,14023,14701,15211,15793,23521,26797,27133,32657,38081,
%U 38503,43213,43621,48133,67721,72433,85879,94249,97393,104977,113201,128143,161701
%N Strong pseudoprimes to base 40.
%H R. J. Mathar, <a href="/A020266/b020266.txt">Table of n, a(n) for n = 1..300</a>
%H <a href="/index/Ps#pseudoprimes">Index entries for sequences related to pseudoprimes</a>
%t strongPseudoprimeQ[b_, n_] := Module[{rems = Table[PowerMod[b, (n - 1)/2^expo, n], {expo, 0, IntegerExponent[n - 1, 2]}]}, (rems[[-1]] == 1 || MemberQ[rems, n - 1]) && PowerMod[b, n - 1, n] == 1]; max = 5000; Select[Complement[Range[2, max], Prime[Range[PrimePi[max]]]], strongPseudoprimeQ[40, #] &] (* _Alonso del Arte_, Aug 05 2018 *)
%K nonn
%O 1,1
%A _David W. Wilson_