(self, n)
Return the indices i, j of the primes that bound n.

        If n is prime then i == j.

        Although n can be an expression, if ceiling cannot convert
        it to an integer then an n error will be raised.

        Examples
        ========

        >>> from sympy import sieve
        >>> sieve.search(25)
        (9, 10)
        >>> sieve.search(23)
        (9, 9)
Return the indices i, j of the primes that bound n.
Return the indices i j of the primes that bound n .
def search(self, n):
        """Return the indices i, j of the primes that bound n.

        If n is prime then i == j.

        Although n can be an expression, if ceiling cannot convert
        it to an integer then an n error will be raised.

        Examples
        ========

        >>> from sympy import sieve
        >>> sieve.search(25)
        (9, 10)
        >>> sieve.search(23)
        (9, 9)
        """
        from sympy.functions.elementary.integers import ceiling

        # wrapping ceiling in int will raise an error if there was a problem
        # determining whether the expression was exactly an integer or not
        test = int(ceiling(n))
        n = int(n)
        if n < 2:
            raise ValueError("n should be >= 2 but got: %s" % n)
        if n > self._list[-1]:
            self.extend(n)
        b = bisect(self._list, n)
        if self._list[b - 1] == test:
            return b, b
        else:
            return b, b + 1
def search ( self , n ) : from sympy . functions . elementary . integers import ceiling # wrapping ceiling in int will raise an error if there was a problem # determining whether the expression was exactly an integer or not test = int ( ceiling ( n ) ) n = int ( n ) if n < 2 : raise ValueError ( "n should be >= 2 but got: %s" % n ) if n > self . _list [ - 1 ] : self . extend ( n ) b = bisect ( self . _list , n ) if self . _list [ b - 1 ] == test : return b , b else : return b , b + 1