OFFSET
1,1
COMMENTS
A prime p is regular if and only if the numerators of the Bernoulli numbers B_2, B_4, ..., B_{p-3} (A000367) are not divisible by p.
REFERENCES
Z. I. Borevich and I. R. Shafarevich, Number Theory. Academic Press, NY, 1966, pp. 425-430.
H. M. Edwards, Fermat's Last Theorem, Springer, 1977.
N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence).
LINKS
T. D. Noe, Table of n, a(n) for n = 1..10000
C. K. Caldwell, The Prime Glossary, Regular prime.
K. Conrad, Fermat's Last Theorem For Regular Primes.
Ernest G. Hibbs, Component Interactions of the Prime Numbers, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33.
F. Luca, A. Pizarro-Madariaga, and C. Pomerance, On the counting function of irregular primes, 2014.
O. A. Ivanova, Regular prime number.
D. Jao, PlanetMath.org, Regular prime.
A. L. Robledo, PlanetMath.org, Examples of regular primes.
Eric Weisstein's World of Mathematics, Regular Prime.
MATHEMATICA
s = {}; Do[p = Prime@n; k = 1; While[2k <= p - 3 && Mod[Numerator@BernoulliB[2k], p] != 0, k++ ]; If[2k > p - 3, AppendTo[s, p]], {n, 2, 80}]; s (* Robert G. Wilson v Sep 20 2006 *)
PROG
(PARI) is(p)=forstep(k=2, p-3, 2, if(numerator(bernfrac(k))%p==0, return(0))); isprime(p) \\ Charles R Greathouse IV, Feb 25 2014
(Python)
from sympy import prime, isprime, bernoulli
def ok(n):
for k in range(2, n - 2, 2):
if bernoulli(k).as_numer_denom()[0] % n == 0:
return 0
return isprime(n)
[n for n in range(3, 501) if ok(n)] # Indranil Ghosh, Jun 27 2017, after Charles R Greathouse IV
CROSSREFS
KEYWORD
nonn,nice
AUTHOR
EXTENSIONS
Corrected by Gerard Schildberger, Jun 01 2004
STATUS
approved