Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Problem 313. Pythagorean perfect squares: find the square of the hypotenuse and the length of the other side

Created by Bruce Raine

Given the square root of a square number, seed, and a range, n, find the square number, Z as well as the other side, y, the square root of a square number i.e. return the hypotenuse squared as well as the length of the other side. Note that n is the number of squares to search through starting with one.

HINT: Z = seed^2 + y^2 where Z = z^2, find Z first and then y.

Note that Z, seed^2 and y^2 are all perfect squares.

>> [z s] = findPerfectZ(3,6)

z = 25

s = 4

>>

Tags

Problem Group

Solution Statistics

44 correct solutions 40 incorrect solutions
Last solution submitted on Jul 23, 2014

Problem Comments