Loïc Grenié on Wed, 01 Mar 2023 10:37:59 +0100


[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: private primes table name




On Wed March 1st, 2023 at 01:39, Jean-Luc ARNAUD wrote:
Hi all,

What's the name of the private primes table?

How could I directly access to it, for example in order to extract the
xth prime number?

    It slightly depends on what you call the "private" primes table
  (and, as Bill said, whether you are accessing from gp or C).
  Still assuming gp,

 - if you want the list of precomputed primes, you can do
primes([1,default(primelimit)])
 - if you want the list of added primes through addprimes, you can do
addprimes()

   In C, the list of precomputed primes does not really exist in memory,
  but you can get a "GEN" containing them using either primes() (the
  GEN will be a vector) or primes_zv() (the GEN will be a Vecsmall, so
  you are limited to primes up to a long size, which should be sufficient
  for what you are interested in).

      Best,

           Loïc