I am having trouble solving for a closed form of the following recurrence relation.
$$\begin{align*} a_n &= \frac{n}{4} -\frac{1}{2}\sum_{k=1}^{n-1}a_k\\ a_1 &= \frac{1}{4} \end{align*}$$ The first few values are $a_1=\frac{1}{4},a_2=\frac{3}{8},a_3=\frac{7}{16},a_4=\frac{15}{32}...$ So it seems the pattern is $a_n = \frac{2^{n}-1}{2^{n+1}}$, but I have been unable to show this algebraically. Here is what I tried: $$\begin{align*} 2a_n &= \frac{n}{2} - \sum_{k=1}^{n-1}a_k\\ a_n + \sum_{k=1}^n a_k &= \frac{n}{2}\\ a_{n-1} + \sum_{k=1}^{n-1} a_k &= \frac{n-1}{2} \\ 2a_n - a_{n-1} & = \frac{1}{2} \\ a_n = \dfrac{2a_{n-1} + 1}{4} \end{align*}$$
I am so close, I can taste the closed form. Can someone nudge me in the right direction without giving too much away?
By inspection we determine a particular solution to $2a_n-a_{n-1}=1/2$ is given by $a_n=1/2$ trivially -- try an ansatz of the form $a_n=k$ and thus we get $k=2k-k=1/2$.
Considering the homogeneous case, $2a_n-a_{n-1}=0$, let $a_n=\lambda^n$ hence:$$2\lambda^n-\lambda^{n-1}=0\\2\lambda-1=0\\\lambda=\frac12$$... and so it follows that $a_n=(1/2)^n=1/2^n$ is a solution to our general equation and further so is any scalar multiple (since our equation is linear) i.e. $a_n=C/2^n$. Adding our particular equation to the mix we get a solution of the form $a_n=C/2^n+1/2$. Impose your initial conditions to determine $C$.