'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)'

def search(self, n):

    from sympy.functions.elementary.integers import ceiling
    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))
