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

5 visualizaciones (últimos 30 días)
Anthony Zúñiga
Anthony Zúñiga el 15 de En. de 2019
Comentada: Walter Roberson el 26 de Mayo de 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?

Respuestas (1)

Abdul Muneeb
Abdul Muneeb el 26 de Mayo de 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 comentario
Walter Roberson
Walter Roberson el 26 de Mayo de 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.

Iniciar sesión para comentar.

Categorías

Más información sobre Resizing and Reshaping Matrices en Help Center y File Exchange.

Etiquetas

Productos


Versión

R2016a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by