# Laverne starts counting out loud by 5's. She starts with 7. As Laverne counts, Shirley sums the numbers Laverne says. When the sum finally exceeds 5000, Shirley runs screaming from the room. What number did Laverne last say before Shirley flees?

## 5000-7 = 4993

4993 = 5*998 + 3

7+4990 = 4997

The next number would have been 5002

Or, using modulo 5 math,

7 = 2(mod 5)

5000 = 0(mod 5)

So, 5002 = 2 (mod 5)

## Steve: your answer is wrong because it says she stops when the sum exceeds 5000, not a number in the sequence

## To find the number Laverne last said before Shirley flees, we need to calculate the sum of the numbers Laverne says. Given that Laverne starts with 7 and counts by 5's, we can create a sequence of numbers she says:

7, 12, 17, 22, 27, 32, ...

To find the sum of this sequence, we can use an arithmetic progression formula:

Sum = ((first term + last term) / 2) * number of terms.

Since we don't know the last term yet, we'll find the sum for an arbitrary number of terms, and then we can determine the last term by checking which term exceeds 5000.

Let's calculate the sum for 7, 12, 17, 22, and so on:

Sum = ((7 + last term) / 2) * number of terms.

Considering the difference between terms is 5, we can rewrite the formula as follows:

Sum = (7 + 7 + ((n - 1) * 5)) * (n / 2),

where n is the number of terms.

Now, we can plug in values for n starting from 1, and check which term's sum exceeds 5000.

Let's calculate the sum for n = 1, 2, 3, 4, 5, and so on, until the sum exceeds 5000:

For n = 1:

Sum = (7 + 7) * (1 / 2) = 14 * 0.5 = 7.

For n = 2:

Sum = (7 + 12) * (2 / 2) = 19 * 1 = 19.

For n = 3:

Sum = (7 + 17) * (3 / 2) = 24 * 1.5 = 36.

For n = 4:

Sum = (7 + 22) * (4 / 2) = 29 * 2 = 58.

For n = 5:

Sum = (7 + 27) * (5 / 2) = 34 * 2.5 = 85.

Continuing this pattern, we can calculate the following terms until we find a sum exceeding 5000:

For n = 6:

Sum = (7 + 32) * (6 / 2) = 39 * 3 = 117.

For n = 7:

Sum = (7 + 37) * (7 / 2) = 44 * 3.5 = 154.

For n = 8:

Sum = (7 + 42) * (8 / 2) = 49 * 4 = 196.

For n = 9:

Sum = (7 + 47) * (9 / 2) = 54 * 4.5 = 243.

For n = 10:

Sum = (7 + 52) * (10 / 2) = 59 * 5 = 295.

For n = 11:

Sum = (7 + 57) * (11 / 2) = 64 * 5.5 = 352.

For n = 12:

Sum = (7 + 62) * (12 / 2) = 69 * 6 = 414.

For n = 13:

Sum = (7 + 67) * (13 / 2) = 74 * 6.5 = 481.

For n = 14:

Sum = (7 + 72) * (14 / 2) = 79 * 7 = 553.

At n = 14, the sum exceeds 5000 (specifically, it reaches 553). Therefore, the last number Laverne says before Shirley flees the room is 72.