When $\begin{pmatrix} a \\ b \end{pmatrix}$ is projected onto $\begin{pmatrix} \sqrt{3} \\ 1 \end{pmatrix},$ the resulting vector has magnitude $\sqrt{3}.$  Also, $a = 2 + b \sqrt{3}.$  Enter all possible values of $a,$ separated by commas.
<|im_start|>system
You are a helpful assistant.<|im_end|>
<|im_start|>user
When $\begin{pmatrix} a \\ b \end{pmatrix}$ is projected onto $\begin{pmatrix} \sqrt{3} \\ 1 \end{pmatrix},$ the resulting vector has magnitude $\sqrt{3}.$  Also, $a = 2 + b \sqrt{3}.$  Enter all possible values of $a,$ separated by commas.
Please reason step by step, and put your final answer within \boxed{{}}.<|im_end|>
<|im_start|>assistant

user
2
When $\begin{pmatrix} a \\ b \end{pmatrix}$ is projected onto $\begin{pmatrix} \sqrt{3} \\ 1 \end{pmatrix},$ the resulting vector has magnitude $\sqrt{3}.$  Also, $a = 2 + b \sqrt{3}.$  Enter all possible values of $a,$ separated by commas.
train