login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A181781
Numbers n that are Euler pseudoprimes to some base b, 2 <= b <= n-2.
3
21, 25, 33, 45, 49, 57, 65, 69, 77, 85, 91, 93, 105, 117, 121, 125, 129, 133, 141, 145, 153, 161, 165, 169, 175, 177, 185, 189, 201, 205, 209, 213, 217, 221, 225, 231, 237, 245, 247, 249, 253, 259, 261, 265, 273, 285, 289, 297, 301, 305, 309, 321, 325, 329, 333, 341, 343, 345
OFFSET
1,1
LINKS
MAPLE
isEulPSP := proc(n, b) if isprime(n) then false; else m := modp(b &^ ((n-1)/2), n) ; if m= 1 or m = n-1 then true; else false; end if; end if; end proc:
isA181781 := proc(n) for b from 2 to n-2 do if isEulPSP(n, b) then return true; end if; end do: return false; end proc:
for n from 3 to 800 do if isA181781(n) then printf("%d, ", n) ; end if; end do: # R. J. Mathar, May 30 2011
MATHEMATICA
fQ[n_?PrimeQ, b_] = False; fQ[n_, b_] := Block[{p = PowerMod[b, (n - 1)/2, n]}, p == Mod[1, n] || p == Mod[-1, n]]; gQ[n_] := AnyTrue[Range[2, n - 2], fQ[n, #] &]; Select[2 Range[172] + 1, gQ] (* Michael De Vlieger, Sep 09 2015, after Jean-François Alcover at A006970, Version 10 *)
PROG
(See Rexx program in Links.)
CROSSREFS
Sequence in context: A274178 A118578 A276700 * A324551 A338081 A118568
KEYWORD
nonn
AUTHOR
Karsten Meyer, Nov 12 2010
EXTENSIONS
Definition corrected by Max Alekseyev, Nov 12 2010
Edited definition to be consistent with OEIS style. - N. J. A. Sloane, Nov 13 2010
STATUS
approved