# Can anybody help me to solve this? Its a Triangle sequence

18 views (last 30 days)
Anthony Zúñiga on 15 Jan 2019
Commented: Walter Roberson on 26 May 2019
A sequence of triangles is constructed in the following way:
1) the first triangle is Pythagoras' 3-4-5 triangle
2) the second triangle is a right-angle triangle whose second longest side is the hypotenuse of the first triangle, and whose shortest side is the same length as the second longest side of the first triangle
3) the third triangle is a right-angle triangle whose second longest side is the hypotenuse of the second triangle, and whose shortest side is the same length as the second longest side of the second triangle etc.
Each triangle in the sequence is constructed so that its second longest side is the hypotenuse of the previous triangle and its shortest side is the same length as the second longest side of the previous triangle.
What is the area of a square whose side is the hypotenuse of the nth triangle in the sequence?

Abdul Muneeb on 26 May 2019
n=3
sides=[3 4 5];
if (n>1)
for i=1:(n-1)
sides=[sides(2) sides(3) (sides(2)^2+sides(3)^2)^0.5]
end
end
sort([sides])
Area =(sides(3))^2 % sides(3) is long side

#### 1 Comment

Walter Roberson on 26 May 2019
This is not incorrect (though the sort is not doing anything for you there). However, the question reads to me as a formula question, what the formula is for arbitrary n.
There is a fomula that is not too difficult to recognize with a small bit of experimentation. It can even be calculated directly, thanks to Binet's formula.