# The Complex Apartment Complex. A new seven-story apartment building is opening in our town. I was curious when I read that the apartments on the higher floors were more expensive, so I went to the open house. I discovered that there is only one very large apartment on the top floor. Each floor has twice as many apartments as the floor above it. The lowest floor contains only one-room studio apartments that are very small. How many apartments are in this new building?

The topmost floor has only 1 apartment so the one below has 2 apartments, the one below has 4 apartments, the one below that has 8 etc.

This is a geometric sequence: 1, 2, 4, 8, 16, 32, 64.

One approach to this problem would be to simply add all those numbers:

`1+2+4+8+16+32+64=127`

The other approach (which is especially good for large numbers and long sequences) is to use formula for sum of the first `n` terms of geometric series.

`S=a(1-r^n)/(1-r),`  `r ne 1`

where `a` is the first term and `r` is the common ratio of the series.

In this case `a=1` and `r=2,` hence we have

`S=(1-2^7)/(1-2)=127`

The result is, of course, the same. There are 127 apartments in the building.