jacobi symbol formula site:math.stackexchange.com - Search