class_docstr: A list of prime numbers, implemented as a dynamically
  growing sieve of Eratosthenes. When a lookup is requested involving
  an odd number that has not been sieved, the sieve is automatically
  extended up to that number. Implementation details limit the number of
  primes to ``2^32-1``.
  
  Examples
  ========
  
  >>> from sympy import sieve
  >>> sieve._reset() # this line for doctest only
  >>> 25 in sieve
  False
  >>> sieve._list
  array('L', [2, 3, 5, 7, 11, 13, 17, 19, 23])
class_docstr_tok: ["A","list","of","prime","numbers",",","implemented","as","a","dynamically","growing","sieve","of","Eratosthenes",".","When","a","lookup","is","requested","involving","an","odd","number","that","has","not","been","sieved",",","the","sieve","is","automatically","extended","up","to","that","number",".","Implementation","details","limit","the","number","of","primes","to","``","2^32-1","``",".","Examples","========",">",">",">","from","sympy","import","sieve",">",">",">","sieve._reset","(",")","#","this","line","for","doctest","only",">",">",">","25","in","sieve","False",">",">",">","sieve._list","array","(","'","L","'",",","[","2",",","3",",","5",",","7",",","11",",","13",",","17",",","19",",","23","]",")"]
docstr: Initial parameters for the Sieve class.
  
  Parameters
  ==========
  
  sieve_interval (int): Amount of memory to be used
  
  Raises
  ======
  
  ValueError
      If ``sieve_interval`` is not positive.
docstr_tok: ["Initial","parameters","for","the","Sieve","class",".","Parameters","==========","sieve_interval","(","int",")",":","Amount","of","memory","to","be","used","Raises","======","ValueError","If","``","sieve_interval","``","is","not","positive","."]
code: def __init__(self, sieve_interval=1_000_000):
      """Initial parameters for the Sieve class.
  
      Parameters
      ==========
  
      sieve_interval (int): Amount of memory to be used
  
      Raises
      ======
  
      ValueError
          If ``sieve_interval`` is not positive.
  
      """
      self._n = 6
      self._list = _array("L", [2, 3, 5, 7, 11, 13])  # primes
      self._tlist = _array("L", [0, 1, 1, 2, 2, 4])  # totient
      self._mlist = _array("i", [0, 1, -1, -1, 0, -1])  # mobius
      if sieve_interval <= 0:
          raise ValueError(
              "sieve_interval should be a positive integer"
          )
      self.sieve_interval = sieve_interval
      assert all(
          len(i) == self._n
          for i in (self._list, self._tlist, self._mlist)
      )
  
imports: from bisect import bisect, bisect_left
  from itertools import count
  from array import array
  from sympy.core.function import Function
  from sympy.core.random import randint
  from sympy.core.singleton import S
  from sympy.external.gmpy import sqrt
  from .primetest import isprime
  from sympy.utilities.misc import as_int
label_desc: Use image node_id 1 to create a new Sieve object  with example: obj = Sieve(sieve_interval)