Let $p,q,w$ be positive integers such that: $$ 1+p+q\sqrt{3} = (2+\sqrt{3})^{2w-1}$$ $\texttt{ }$ Prove that $p$ is a perfect square.
I have observed that the $RHS$ is raised to an odd power, and that the number of terms of $RHS$ equal to $2w\texttt{ }$ So we get that, $$1+p+q\sqrt{3} = 4^w + 3^w +(2w-2\texttt{ } terms)$$
And I can't proceed further.
First off, you can prove that $1+p-q\sqrt{3}=(2-\sqrt{3})^{2w-1}$. By using binomial to expand the right-handed side and compare the coefficients, we obtain $$p=2^{2w-1}+\binom{2w-1}{2}2^{2w-3}\cdot 3+\binom{2w-1}{4}2^{2w-5}\cdot 3^2+...+\binom{2w-1}{2w-2}2\cdot 3^{w-1}-1$$ Thus, $p$ is odd. Note also that $$(1+p)^2-3q^2=(1+p+q\sqrt{3})(1+p-q\sqrt{3})=(2+\sqrt{3})^{2w-1}(2-\sqrt{3})^{2w-1}=1$$ Let $p=l-1$ the equality above becomes, since $p$ is odd we have $l$ is even,$(l-1)(l+1)=3q^2$ and $\gcd(l-1,l+1)=1$, since $l$ is even. So we have $2$ cases, as follows.
Case 1 : $l-1 = 3x^2,l+1=y^2$ for some positive integer $x,y$. In this case we have both $x,y$ are odd since $l$ is even and thus $x^2,y^2\equiv 1\pmod 8$ and we have $y^2-3x^2=2$ which is impossible since, this will leads us to $$2=y^2-3x^2\equiv -2\pmod 8$$
Case 2 : $l-1 = x^2,l+1=3y^2$ for some positive integer $x,y$. In this case the result follows $p=l-1=x^2$ as desired $\Box$