Quadratic residuosity is in $\mathsf{NP}$, since to prove $x$ is quadratic residue you can show $y$ such that $y^2=x$.
Wikipedia claims the problem is in $\mathsf{coNP}$. This book claims it is not known. Is it?
It seems at:
- When $n$ is prime, one can use Euler's criterion so the problem is in $\mathsf{P}$,
- In general case one can give factorization of $n$ and reduce the problem to $n=p^k$.
Am I correct?
I think you are correct.
First of all, the prover can provide the prime factorization of $n$, so without loss of generality assume $n = p^k$ for some $k$. We have thus reduced the problem to the prime powers.
I am taking the following sets of rules for determining if a number is a quadratic residue or not modulo $p^k$ from this wikipedia page. Be careful in reading the wikipedia page since it uses a different notation than in the question.
And for $p=2$:
So we are finally reduced to the case of checking whether a given number is a quadratic residue or nonresidue modulo a prime $p$. But as the OP notes, that can be easily done in deterministic polynomial time using Euler's criterion.