pub fn legendre_symbol(a: &BigInt, p: &BigInt) -> i32