Let $a_n$ be a sequence such that $a_0=5$ and $a_{n}+a_{n+1}=3$ for all $n$ greater than $0$.
I defined a function $f(x)$ whose coefficients are same of that mentioned sequence. I was able to get $$f(x)=\displaystyle \sum_{n=0}^\infty [ 5 (-1)^n x^n + 3 (-1)^n x^{n+1} + 3 x^{2n+1} ] $$ But couldn't make it far. How do you find a formula for $a_n$ given that $a_1$ is just $1$?
Define $b_n=a_n-1.5$. Therefore$$b_n+b_{n+1}=0$$which means that$$b_{n+1}=b_1(-1)^n$$or $$a_n=1.5+k(-1)^n$$with $a_1=1$ we have $$a_1=1=1.5+k(-1)\to k= 0.5$$therefore $$a_n={3+(-1)^n\over 2}$$