1. Given are vectors $\vec{a}=(2,1, p)$ and $\vec{b}=(2, p+1,4)$.

a) Determine all possible values of the parameter $p$ for which there exists a vector $\vec{v}$ such that:

$$
\begin{aligned}
\vec{a} \cdot \vec{v} & =|\vec{b}| \\
\vec{a} \times \vec{v} & =\vec{b}
\end{aligned}
$$

b) For each such value of $p$, determine all such vectors $\vec{v}$, and for each of them, determine the angles they form with $\vec{a}$ and $\vec{b}$.
1. a) From the second equation, it follows that $\vec{b} \perp \vec{a}$, so we have $\vec{b} \cdot \vec{a}=0$, i.e., $4+(p+1)+4 p=0$, and from this we get $p=-1$. Thus, this value is the only one that matters for the parameter $p$, provided we can find a vector $\vec{v}$ as required (which will turn out to be possible in the next part of the problem).

b) We have $\vec{a}=(2,1,-1)$ and $\vec{b}=(2,0,4)$, and let $\vec{v}=(x, y, z)$. Then from the first equality in the problem statement, we have $2 x+y-z=\sqrt{2^{2}+0^{2}+4^{2}}=2 \sqrt{5}$, and from the second $(z+y,-2 z-x, 2 y-x)=(2,0,4)$, i.e., also $z+y=2$ and $x+2 z=0$ (we omit the last equation as it is a consequence of the first two). By substituting, for example, $x=-2 z$ and $y=2-z$ from the last two equations into the first, we get $-6 z+2=2 \sqrt{5}$, i.e., $z=\frac{1-\sqrt{5}}{3}$, and then we find $\vec{v}=\left(\frac{2 \sqrt{5}-2}{3}, \frac{5+\sqrt{5}}{3}, \frac{1-\sqrt{5}}{3}\right)$, which is, therefore, the unique solution for $\vec{v}$. Finally, $\vec{v}$ forms a $90^{\circ}$ angle with $\vec{b}$, which is immediately clear from the second equality in the problem statement, and if we denote by $\varphi$ the angle that $\vec{v}$ forms with $\vec{a}$, then we have $\cos \varphi=\frac{\vec{a} \cdot \vec{a}}{|\vec{a}| \vec{v} \mid}=\frac{2 \sqrt{5}}{\sqrt{6} \cdot \sqrt{\frac{20}{3}}}=\frac{\sqrt{2}}{2}$, i.e., $\varphi=45^{\circ}$.