title: Efficiently calculating all pythagorean triples knowing the hypoteneuse
body: <p>Given a hypoteneuse (<code>c</code> in the typical equation <code>a*a + b*b = c*c</code>), what is an efficient way to calculate all possible integer values of <code>a</code> and <code>b</code>, such that <code>a &lt; b</code>?</p>
  
  <p>Note: I've seen <code>c</code> be greater than <code>1e12</code>, thus <code>c*c</code> is greater than <code>long.MaxValue</code>, from what I can tell, <code>c*c</code> does fit into a <code>decimal</code>, though.</p>