RE: Writing a program to hunt for a prime between n^2 and (n+1)^2

• To: mathgroup at smc.vnet.net
• Subject: [mg39190] RE: [mg39168] Writing a program to hunt for a prime between n^2 and (n+1)^2
• From: "Harvey P. Dale" <hpd1 at nyu.edu>
• Date: Mon, 3 Feb 2003 01:08:42 -0500 (EST)
• Sender: owner-wri-mathgroup at wolfram.com

```Diana:
This should do it:
primeBetween[n_] := Module[{ppn = PrimePi[n^2] + 1, ppn1 =
PrimePi[(n +
1)^2]}, Prime[Range[ppn, ppn1]]]
Best,
Harvey
Harvey P. Dale
University Professor of Philanthropy and the Law
Director, National Center on Philanthropy and the Law
New York University School of Law
Room 206A
110 West 3rd Street
New York, N.Y. 10012-1074

-----Original Message-----
From: Diana [mailto:diana53xiii at earthlink.remove13.net]
To: mathgroup at smc.vnet.net
Subject: [mg39190] [mg39168] Writing a program to hunt for a prime between n^2 and
(n+1)^2

Folks,

I am trying to come up with a snazzy way to hunt for a prime between n^2
and
(n+1)^2.

Some ideas?

Thanks, Diana
--
"God made the integers, all else is the work of man."
L. Kronecker, Jahresber. DMV 2, S. 19.

```

• Prev by Date: Re: Random Trouble
• Next by Date: RE: Random Trouble
• Previous by thread: Re: Writing a program to hunt for a prime between n^2 and (n+1)^2
• Next by thread: Re: Re: Writing a program to hunt for a prime between n^2 and (n+1)^2