Find row of pyramid based on index?
Given a pyramid like: 0 1 2 3 4 5 6 7 8 9 ... and given the index of the pyramid i where i represents the i th number of the pyramid, is there a way to find the index of the row to which the i th element belongs? (e.g. if i = 6,7,8,9 , it is in the 3rd row, starting from row 0) There's a connection between the row numbers and the triangular numbers. The nth triangular number , denoted T n , is given by T n = n(n-1)/2. The first couple triangular numbers are 0, 1, 3, 6, 10, 15, etc., and if you'll notice, the starts of each row are given by the nth triangular number (the fact that they come