Consider all real $n\times n$ diagonal matrices of the form
$$ \Lambda =\begin{pmatrix} 1 \\ & \ddots \\ & & 1 \\ &&& -1 \\ &&&& \ddots \\ &&&&& -1 \\ \end{pmatrix} $$
where the number of $1$s equals $p(\Lambda)$
I've a basic question- can two such matrices $\Lambda$, $\Lambda^{'}$ with $p(\Lambda)\neq p(\Lambda^{'})$ be congruent over $\mathbb R$?
i.e. can we find an invertible $n\times n$ matrix $P$ over $\mathbb R$ s.t. $\Lambda^{'}=P^{\rm T}\Lambda P$ ? Many thanks.
Edit: previous answer about spectra was incorrect, I confused $PAP^{-1}$ with $PAP^T$.
The relevant information is given in Git Gud's link in the comments to Sylvester's law of inertia.