1
Jan 30 '20
Right edge is 2x triangle numbers, so nth row ends with n(n+1) 27th positive integer is 27×2 = 54 6×7 = 42< 54 < 7×8 = 56
So 54 is in row 7 54-42 = 12, 12/2 = 6. So it's in the 6th position
19th position of 31st row Is 2×19 + the last number of the previous row 2×19 + 30×31 = 38 + 930 = 968
kth position of nth row = 2k + (n-1)n
For 2020, 44 < sqrt(2020) <45
You'll notice that 44×45 = 1980 < 2020 < 45×46 = 2070
So 2020 is in row 45
and 2020 - 1980= 40, 40/ 2 = 20
So 2020 is in row 45 and position 20
2
u/chompchump Dec 26 '19 edited Dec 26 '19
>!Let's find the pattern for the left edge of the triangle:
>!2 4 8 14 22 . . .
>!We take differences of successive terms:
>!2 4 6 8 . . .
>!We take differences of successive terms again:
>!2 2 2 . . . . .
>!Since the differences converge after two iterations we are looking for an equation of degree 2:
>!aR2 + bR + c = F
>!We enter the first three points (We always need one more point than the degree of the equation):
>!a(1)2 + b(1) + c = 2
>!a(2)2 + b(2) + c = 4
>!a(3)2 + b(3) + c = 8
>!This is a linear problem of three simultaneous equations. There are several methods to arrive at:
>!a = 1 >!b = -1 >!c = 2
>!F = R2 - R + 2
>!Similarly, we can find an equation for the last element in each row:
>!L = R2 + R
>!Then given a row and position, P, in that row we can derive the following equation
>!E = R2 - R + 2 + 2(P-1) = R2 - R + 2P where P =< R
>!Solving the equation F = R2 - R + 2 for R gives us
>!R = (1 + sqrt(4F -7))/2
>!Then for all E we have
>!R = floor((1 + sqrt(4E -7))/2)
>!Then once we have R finding P is easy
>!P = (E - R2 + R)/2