I'm writing a program to calculate quadratic residue of a number and for prime number it is mentioned that if p mod 8 equals 5 then there two ways to calculate x (check the pic). the part that I don't understand is it says if a is quartic residue mod n. How are we supposed to know if a is quartic residue or nonresidue? for example: x^2 = 3296748 mod 3409573 ? how do you know if 3296748 is a quartic residue? The formula mentioned in wikipedia
https://en.wikipedia.org/wiki/Quadratic_residue#Prime_or_prime_power_modulus