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.

A181781 Numbers n that are Euler pseudoprimes to some base b, 2 <= b <= n-2.

Original entry on oeis.org

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

Views

Author

Karsten Meyer, Nov 12 2010

Keywords

Crossrefs

Programs

  • 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 *)

Extensions

Definition corrected by Max Alekseyev, Nov 12 2010
Edited definition to be consistent with OEIS style. - N. J. A. Sloane, Nov 13 2010