We fix an integer $n\geq 2$. Let $S_n$ be the set of real symmetric matrices in $M_n(\mathbb{R})$. We consider the algebraic sets $Y_k=\{A\in M_n(\mathbb{R});A^k\in S_n\},k\geq 2$ and the sequence $d_k=dim(Y_k),k\geq 2$.

It is not too difficult to prove that the minimum of $(d_k)$ is $\dfrac {n(n+1)}{2}$ and is reached for $k=2$.

$\textbf{Conjecture}$. The maximum of $(d_k)$ is $n^2-n+1$ and is reached for $k=n$.

$\textbf{Remarks}$. i) Note that $Y_n\supset Z_n=\{A\in M_n(\mathbb{R}); A^n$ is a scalar matrix$\}$ and we can prove that $dim(Z_n)=n^2-n+1$.

ii) On the other hand, a formal calculation, using Grobner bases, shows that the conjecture is true for $n=2,3,4$ (at least with a great probability, because we cannot test all values of $k$).

$\textbf{Question}$. Is the above conjecture true for every $n$ ?

Thanks in advance.