Prove that the sum $2^0+2+2^2+\cdots+2^{p-1}(2^p-1)$ is $2^{p-1}(2^p-1)$ Attempt: In an attempt to find the sum of the series given that $2^{p-1}$ is prime,
$$1+2+2^2+\cdots+2^{p-2}+2^{p-1}+(2^p-1)+2(2^p-1)+2^2(2^p-1)+\cdots+2^{p-1}(2^p-1)$$
A teacher grouped elements as follows,
$$(1+2^p-1)+2(1+2^p-1)+2^2(1+2^p-1)+\cdots+2^{p-2}(1+2^p-1)+2^{p-1}$$
Question: I am confused a little about the last two terms in the summation above as what I think it should be is as follows,
$$(1+2^p-1)+2(1+2^p-1)+2^2(1+2^p-1)+\cdots+2^{p-2}(1+2^p-1)+2^{p-1}(1+2^p-1)$$
Edit:
Question: I should get the sum $2^{p−1}(2^p − 1)$, but with the way I wrote it I did not get the sum wanted, but I got $2^p(2^p-1)$ for,
$$(1+2^p-1)+2(1+2^p-1)+2^2(1+2^p-1)+\cdots+2^{p-2}(1+2^p-1)+2^{p-1}(1+2^p-1)$$
Edit 2: The only solution to this is that the sum is $2^p(2^p-1)$.

Your grouping method is correct. Your teacher seems to have made a mistake.
From your sum you get
$$(1+2^p-1)+2(1+2^p-1)+2^2(1+2^p-1)+\cdots+2^{p-2}(1+2^p-1)+2^{p-1}(1+2^p-1)$$
which is equal to
$$(2^p)+2(2^p)+2^2(2^p)+\cdots+2^{p-2}(2^p)+2^{p-1}(2^p)=$$
$$2^p(2+2^2+...+2^{p-1})$$
Now, you only have to solve
$$2+2^2+...+2^{p-1}$$
and multiply by $2^p$ and get your answer. Is that clear?
