## Task A-1.7. (20 points)

At Ana's birthday party, after the first ringing of the doorbell, one guest arrived. After the second, and each subsequent ringing, two more guests arrived than the previous time. If the bell rang $n$ times, how many guests were there at the party in total?
## Solution.

After the first bell, one guest arrived (1 is the first odd number), after the second bell, three guests arrived (3 is the second odd number), after the third bell, five guests arrived (5 is the third odd number),

...

After the $n$-th bell, $2n-1$ guests arrived ($2n-1$ is the $n$-th odd number).

Let $S_{n}$ be the total number of guests after the $n$-th bell:

$$
S_{n}=1+3+5+\ldots+(2n-3)+(2n-1)
$$

(5 points)

We can calculate this sum as follows:

![](https://cdn.mathpix.com/cropped/2024_05_30_59925bf190fc107f19b7g-05.jpg?height=197&width=1334&top_left_y=992&top_left_x=241)

We conclude that $2 S_{n}=2n \cdot n$, so $S_{n}=n^{2}$. There were $n^{2}$ guests at the celebration.