<s>[INST] How to solve the following expression I have the following expression: $2^{n-3}+\sum_{k=1}^{n-3} 2^{k-1}(n-k+1)^2$ and I have no idea how to solve it. I tried plugging it in WolframAlpha to get an idea but it gives me $-n^2 - 4 n + 7 \cdot 2^{n - 1} - 6$ and I have even less of an idea how I would get there.
I don't need the complete solution done. I just would like pointers on how to solve it.
 [/INST] You'll just to simplify the expression
$f(n) = 2^{n-3}+\sum_{k=1}^{n-3} 2^{k-1}*(n-k+1)^2$
Now let's expand 
$f(n) = 2^{n-3}+\sum_{k=1}^{n-3} 2^{k-1}*(n^2-2*k*n+2*n+k^2-2*k+1)$
Let's reduce it
$f(n) = 2^{n-3}+\sum_{k=1}^{n-3} 2^{k-1}*(n^2+2*n+1) +\sum_{k=1}^{n-3} 2^{k-1}*(-2*k*n-2*k) + \sum_{k=1}^{n-3} 2^{k-1}*(k^2)$
Simplify more
$f(n) = 2^{n-3}+ (n^2+2*n+1)*\sum_{k=1}^{n-3} 2^{k-1} -2*(n+1)*\sum_{k=1}^{n-3} k*2^{k-1}+\sum_{k=1}^{n-3} (k^2)*2^{k-1}$
Remember that 
$\sum_{k=1}^{n-3} 2^{k-1} = 1+2+2^2+2^3+...........+2^{n-3-1} = 2^{n-3}-1$
It's becomes difficult here
$\sum_{k=1}^{n-3} k*2^{k-1} = h(x) = k*2^{k-1}+(k-1)*2^{k-2}+(k-2)*2^{k-3}+........+3*2^2+2*2^1+1*2^0$
But It's not so hard to see that 
$h(x)*2-k*2^k = 2*h(x-1)$
You'll need to solve some recurring equation now 
$h(x) = 2^x*(x-1)+1$
$\sum_{k=1}^{n-3} (k^2)*2^{k-1} = g(x) = (k^2)*2^{k-1}+(k-1)^2*2^{k-2}+(k-2)^2*2^{k-3}+........+ 3^2*2^2+2^2*2+1$
Same process involved we can also see that
$g(x)*2 -x^2*2^x = 2*g(x-1)$
So that $g(x) = 2^x*(x^2-2*x+3)-3$
Don't forget that the plugin value is $h(n-3)$ and $g(n-3)$
Therefore
$f(n) = 2^{n-3}+(n^2+2*n+1)*(2^{n-3}-1)-2*(n+1)*(2^{n-3}*(n-3-1)+1)+2^{n-3}*((n-3)^2-2*(n-3)+3)-3$
Expand and simplify this to get our solution
$f(n) = 7*2^{n-1}-n^2-4*n-6$
So you see that the trick is recurring equation, which Wolfram automatically solves
</s>