Calculating finite geometric sum

46 Views Asked by At

What is the sum: $\displaystyle\sum_{n=0}^{31} 2^n$?

I know the formula is $S_n = \frac{a_1 (1-r^n)}{1-r}$ , so I have $$S_n = \frac{1(1-2^{32})}{1-2} = \frac{-4294967295 }{-1} = 4294967295$$

Is this correct?

Similarly for another sum $\sum_{n=32}^{63} 2^n$ , I have

$$\frac{2^{32}(1-2^{32})}{1-2}$$

Is this correct?

2

There are 2 best solutions below

0
On

Yes.

For the second one, if you noticed, is just $2^{32}$ times the first sum.

0
On

In the binary base:

$$1111111111111111111111111111111_b$$ and

$$111111111111111111111111111111100000000000000000000000000000000_b$$