Find $n \geq 3$ odd such that : ${T_n} ^ 2 \equiv (-1)^{\frac {\varphi (n)}{2}} $ Let $T_n$ be the product of numbers less than $[\frac{n}{2}]$ and co-prime to $n$. Find $n \geq 3$ odd such that :
$$T_n^2 \equiv (-1)^{\frac {\varphi (n)}{2}} \pmod n$$
Here is all i did:
It is easy to see that when $\gcd(a,n) = 1$, then $\gcd(n-a,n) =1$
So we only have to find $n$ such that :
$$a_1a_2a_3\cdots a_{\varphi(n)} \equiv 1 \pmod n $$
it is easy to see that $n$ cannot be prime according to Wilson's theorem: $(p-1)! \equiv -1 \pmod p$
But at this point I have no idea at all, I hope to get help from everyone. Thank you very much everyone!
 A: Assuming $n$ is odd, using what you observed about pairing $x$ with $-x \pmod n$, the product of all elements in $\left(\mathbb{Z}/n\mathbb{Z}\right)^\times$ is equal to $(-1)^{\frac{\varphi(n)}{2}}T_n^2 \pmod n$, so the question is equivalent to finding $n$ such that the product of all elements in $\left(\mathbb{Z}/n\mathbb{Z}\right)^\times$ is equal to $1 \pmod n$.
But you can now pair up every unit with its multiplicative inverse $x \leftrightarrow x^{-1} \pmod n$, as long as they are distinct, and you'll get a product of $1$. So the only terms contributing to the product are the elements that are solutions to $x^2 = 1 \pmod n$.
But $-1$ will always be one of these solutions so you will need at least one more nontrivial solution to the equation (you'll actually get two for free because of the $x \leftrightarrow -x$ pairing). The first time this happens for $n$ odd is when $n = 3 \times 5 = 15$, which has solutions $\pm 1, \pm 4$.
And indeed, we can check that $n = 15$ satisfies the requirements.
