Services & Resources / Wolfram Forums
MathGroup Archive
*Archive Index
*Ask about this page
*Print this page
*Give us feedback
*Sign up for the Wolfram Insider

MathGroup Archive 2000

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: PrimeQ queries

  • To: mathgroup at
  • Subject: [mg24245] Re: [mg24213] PrimeQ queries
  • From: "Harvey P. Dale" <hpd1 at>
  • Date: Mon, 3 Jul 2000 20:39:25 -0400 (EDT)
  • Sender: owner-wri-mathgroup at

Greg Keogh wrote:

>Hello from Melbourne Australia,

>I stumbled across some educational notebooks during the week that teach
>basic number theory. One of them contained this function that surprised me:

>primeQ[n_]:=PrimeQ[n] && n!=89*11551*37159 && n<10^15

>Further down I discover that the built-in PrimeQ incorrectly reports these
>numbers as prime:

>89*11551*37159 = 38200901201
>7309*321553*2828197 = 6646915915638769

>I didn't know that PrimeQ had "flaws" in it like this, or that it had an
>upper limit of reliability around 10^15. Could someone point me to some
>resources that might explain more on this matter?
	The two examples you give of numbers which PrimeQ incorrectly
reports as prime are themselves in error.  PrimeQ in Version 4.0 correctly
reports both of them as not being prime.
	For helpful discussions of PrimeQ, see not only the Mathematica book
but the Standard Add-On Packages volume in its description of

  • Prev by Date: Drawing polytopes
  • Next by Date: Detecting and handling error messages?
  • Previous by thread: Re: PrimeQ queries
  • Next by thread: Re: PrimeQ queries