On 12/24/2014 08:35 AM, Hans W Borchers wrote:
> No, You've got a typo.  But, be careful fixing it,
> > it may eat up all your memory.
>
> A typo from copying. The problem is that first the memory error occurs
> and on second call it returns an empty error.
>
>     julia> genprimes(1841378967856, 1850000000000)
>     ERROR: MemoryError()
> in primescopy at /home/hwb/.julia/v0.3/PrimeSieve/src/primesieve_c.jl:40 > in genprimes at /home/hwb/.julia/v0.3/PrimeSieve/src/primesieve_c.jl:60

You are asking for a 2.5 GB array

julia> (countprimes(1841378967856, 1850000000000) * 8)/1e9

    2.441857432

libprimesieve also needs temporary storage. I'm not sure how much. My machine with 8GB
can do this.


>     julia> genprimes(1841378967856, 1850000000000)
>     0-element Array{Int64,1}
>
> Well, I now see that you mention this in the "Bugs" section of the README file.

Yes, I guess libprimesieve is left in a bad state after the memory error.

I wonder what the library means  with tuplets. Is that documented somewhere?

You can find the definition in many places online. For instance, this page is
  linked from the libprimesieve website,

  http://en.wikipedia.org/wiki/Prime_k-tuple

  Look in the table "Named Patterns"


Don't worry. I took an old  script of mine that computed only the first 10-20
> prime octetts (in R or Python) and converted it to Julia (utilizing Julia's > 'isprime'). During this night it computed *all* prime octetts up to 10^12 ,
> and there are hundreds of them, the last one being
>
>     [99452940701, 99452940703, 99452940707, 99452940709,
>      99452940731, 99452940733, 99452940737, 99452940739]
>

That's not a prime octuplet. If you look around on the web, you'll find
the definition in several places, including on the wikipedia page linked above.
It would be interesting to see it implemented.

--John

Reply via email to