The total # of coins you give out is 1 + 2 + 3 + 4 + 5 + and so on
The sum of 1 + 2 + 3 + 4 + . . +n is n*(n+1)/2
You want that total to be less than or equal to 200
n*(n+1)/2 <= 200
multiply both sides by 2
n*(n+1) <= 400
combine on the left
n^2 +n <= 400
subtract 400 from both sides
n^2 +n -400 <= 0
quadratic formula: if ax^2 +bx +c = 0 then x = ( -b +- sqrt((b^2)-4ac) ) / 2a
( -1 +- sqrt((1^2) -4(1)(-400)) ) / 2(1)
( -1 +- sqrt(1+1600) ) / 2
(-1 +- sqrt(1601) ) / 2
n has to be posive so we use the + of the +- above
(-1 + sqrt(1601) ) /2
(-1 + 40.0125) / 2
39.0125 / 2
19.5062
You can give coins to 19 friends, but you don't have enough coins for a 20th friend.
Answer: 19