# Linear Algebra. Orthogonal Projection onto the Span of a vector

Consider a vector $v$ in $\mathbb{R}^n$ of the form $$v = \left[\begin{array}{c} 1 \\ a \\ a^2 \\ \vdots \\ a^{n-1}\end{array}\right]$$ where a is any real number. Let $P$ be the matrix of the Orthogonal projection onto $\mathbb{span}(v)$. Describe the entries of $P$ in terms of $a$.

I cannot seem to figure out how to set this up. Help would be very much appreciated!

First we normalize the vector $v$: $$w=\frac{v}{||v||}=\left(\sum_{k=0}^{n-1}a^{2k}\right)^{-\frac12}v=\sqrt{\frac{1-a^2}{1-a^{2n}}}\;\;\;v$$ Now let $(e_1,\ldots,e_n)$ the standard basis of $\Bbb R^n$ then the projection of $e_k$ onto the subspace $\operatorname{span}(v)$ is given by $$\langle e_k,w\rangle w=\frac{1-a^2}{1-a^{2n}}a^{k-1}v$$ which is the $k^{\text{th}}$ column of the matrix of this orthogonal projection.
$$P(x) = \frac{x\cdot v}{v\cdot v} v$$
Then you replace $x$ by $e_k$ and the expression gives you the $k$th column of the matrix.