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)$.

If I read well you are evaluating the sum
$$ \sum_{k=0}^{p-1}2^k + \sum_{k=0}^{p-1}2^k(2^p-1) = 2^p\sum_{k=0}^{p-1}2^k = 2^p\frac{1-2^p}{1-2} = 2^p(2^p-1)$$
