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

3 visualizzazioni (ultimi 30 giorni)
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?

Risposte (1)

Abdul Muneeb
Abdul Muneeb il 26 Mag 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 Commento
Walter Roberson
Walter Roberson il 26 Mag 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.

Accedi per commentare.

Categorie

Scopri di più su Resizing and Reshaping Matrices in Help Center e File Exchange

Tag

Prodotti


Release

R2016a

Community Treasure Hunt

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

Start Hunting!

Translated by