balls of equal size are arranged in rows to form an equilateral triangle . the top most row consists of one ball , the 2 nd row of two balls and so on . if 1104 balls are added , then all the balls can be arranged in the shape of square and each of the sides of the square contain 8 balls less than the each side of the triangle did . how many balls made up the triangle ?
"as expected , this question boils down to 2 equation , consider total number of balls in triangle = t and number of balls in last row = x . 1 + 2 + 3 + . . . + x = t x ( x + 1 ) / 2 = t - - - - ( a ) as mentioned in the question , side of a square will be ( x - 8 ) and total number of balls in square will be ( t + 1104 ) ( x - 8 ) ^ 2 = t + 1104 - - - - - ( b ) now the hardest part of the question will be to solve these 2 equations and this looks like time consuming but the easy way will be plug and play . also , we ' ve to find a value of t ( from 5 optiosn given below ) which can make a square of a a number . one we know this , it will be a cake walk . we can see that option a fits this criteria in eq ( b ) . add - 2145 + 1104 = 3249 = 57 ^ 2 = ( x - 8 ) ^ 2 hence , x = 65 . cross check by putting in eq ( a ) = x ( x + 1 ) / 2 = t = > 65 * 66 / 2 = 2145 hence , answer is a ."
multiply(subtract(1104, multiply(const_4, const_100)), add(multiply(subtract(1104, multiply(const_4, const_100)), 2), const_1))