MathGroup Archive 2003

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

Search the Archive

Re: Counting Twin Primes

  • To: mathgroup at smc.vnet.net
  • Subject: [mg43622] Re: Counting Twin Primes
  • From: "Borut Levart" <bole79 at email.si>
  • Date: Fri, 26 Sep 2003 04:45:35 -0400 (EDT)
  • References: <bkp0dp$cho$1@smc.vnet.net>
  • Sender: owner-wri-mathgroup at wolfram.com

Hi,

Length[ TwinPrimes[10]]

?


"Allan Haley" <ashaley at nccn.net> wrote in message
news:bkp0dp$cho$1 at smc.vnet.net...
> In the Mathematica reference material, there is a defined function to
> list the twin primes in a given interval, as follows:
>
> TwinPrimes[m__] : = Module[{s = Prime[Range[m]]}, {#, # + 2}& /@
Extract[s,
> Position[Drop[s, 1] - Drop[s, -1], 2]]]
>
> My question is: having defined this function and gotten a list for a
> given (large) interval m, how do I get Mathematica to tell me the number
> of twin prime pairs in that interval?  Trying something like
> Count[{TwinPrimes[m]}, _Integer]/2 just gives the output zero.
>
> Thanks in advance,
>
> Allan Haley
>
>




  • Prev by Date: Incorrect integral
  • Next by Date: Re: Eigenvalues, any suggestions?
  • Previous by thread: Re: Counting Twin Primes
  • Next by thread: Re: Counting Twin Primes