%I A007703 M2411 #51 Apr 22 2025 10:47:58 %S A007703 3,5,7,11,13,17,19,23,29,31,41,43,47,53,61,71,73,79,83,89,97,107,109, %T A007703 113,127,137,139,151,163,167,173,179,181,191,193,197,199,211,223,227, %U A007703 229,239,241,251,269,277,281,313,317,331,337,349,359,367,373,383,397,419,431 %N A007703 Regular primes. %C A007703 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. %D A007703 Z. I. Borevich and I. R. Shafarevich, Number Theory. Academic Press, NY, 1966, pp. 425-430. %D A007703 H. M. Edwards, Fermat's Last Theorem, Springer, 1977. %D A007703 Paulo Ribenboim, The Little Book of Bigger Primes, Springer-Verlag NY 2004. See pp. 223-227. %D A007703 N. J. A. Sloane and Simon Plouffe, The Encyclopedia of Integer Sequences, Academic Press, 1995 (includes this sequence). %H A007703 T. D. Noe, Table of n, a(n) for n = 1..10000 %H A007703 C. K. Caldwell, The Prime Glossary, Regular prime. %H A007703 K. Conrad, Fermat's Last Theorem For Regular Primes. %H A007703 Ernest G. Hibbs, Component Interactions of the Prime Numbers, Ph. D. Thesis, Capitol Technology Univ. (2022), see p. 33. %H A007703 F. Luca, A. Pizarro-Madariaga, and C. Pomerance, On the counting function of irregular primes, 2014. %H A007703 O. A. Ivanova, Regular prime number. %H A007703 D. Jao, PlanetMath.org, Regular prime. %H A007703 A. L. Robledo, PlanetMath.org, Examples of regular primes. %H A007703 Eric Weisstein's World of Mathematics, Regular Prime. %H A007703 Bernoulli numbers, irregularity index of primes %t A007703 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 *) %o A007703 (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 %o A007703 (Python) %o A007703 from sympy import prime, isprime, bernoulli %o A007703 def ok(n): %o A007703 for k in range(2, n - 2, 2): %o A007703 if bernoulli(k).as_numer_denom()[0] % n == 0: %o A007703 return 0 %o A007703 return isprime(n) %o A007703 [n for n in range(3, 501) if ok(n)] # _Indranil Ghosh_, Jun 27 2017, after _Charles R Greathouse IV_ %Y A007703 Cf. A000928 (irregular primes) and A061576 for further references. %K A007703 nonn,nice %O A007703 1,1 %A A007703 _N. J. A. Sloane_, _Simon Plouffe_ %E A007703 Corrected by _Gerard Schildberger_, Jun 01 2004