\(p\left(X\right)+e\left(X\right)+n\left(X\right)=40\)
\(\Leftrightarrow2p\left(X\right)+n\left(X\right)=40\left(1\right)\)
\(p\left(Y\right)+e\left(Y\right)-p\left(X\right)-e\left(X\right)=8\)
\(\Leftrightarrow2p\left(Y\right)-2p\left(X\right)=8\)
\(\Leftrightarrow p\left(Y\right)-p\left(X\right)=4\left(2\right)\)
\(\left(1\right);\left(2\right)\Rightarrow\left\{{}\begin{matrix}2p\left(X\right)+n\left(X\right)=40\\p\left(Y\right)-p\left(X\right)=4\end{matrix}\right.\)
\(\Leftrightarrow\left\{{}\begin{matrix}p\left(X\right)=13\\p\left(Y\right)=17\end{matrix}\right.\)
\(\Rightarrow X:13\) proton \(\Rightarrow X\) là \(Al\)
\(Y:17\) proton \(\Rightarrow Y\) là \(Cl\)