Using the Pythagorean Theorem repeatedly