The quadratic reciprocity law works for Legendre symbols with odd entries, not just primes $\left(\frac{a}{b}\right) = \left(\frac{b}{a}\right) (-1)^{\frac{a-1}{2}\frac{b-1}{2}}.$