def jacobi(a, n):
    """
    The Jacobi symbol (a|n).
    Input:
        a -- any integer
        n -- odd integer
    Output: -1, 0, or 1
    Examples:
    >>> [jacobi(a, 15) for a in [-10, -7, -4, -2, -1, 0, 1, 2, 4, 7, 10]]
    [0, 1, -1, -1, -1, 0, 1, 1, 1, -1, 0]
    >>> [jacobi(a, 13) for a in [-10, -9, -4, -2, -1, 0, 1, 2, 4, 9, 10]]
    [1, 1, 1, -1, 1, 0, 1, -1, 1, 1, 1]
    >>> [jacobi(a, 11) for a in [-10, -9, -4, -2, -1, 0, 1, 2, 4, 9, 10]]
    [1, -1, -1, 1, -1, 0, 1, -1, 1, 1, -1]
    """
    if n % 2 == 0 or n < 0:
        return None
    if a == 0 or a == 1:
        return a
    a, t = a % n, 1
    while a != 0:
        while not a & 1:
            a //= 2
            if n & 7 in (3, 5):
                t *= -1
        a, n = n, a
        if a & 3 == 3 and n & 3 == 3:
            t *= -1
        a %= n
    return t if n == 1 else 0
