Nice.  Here&#x27;s an Erlang version of your code, which I think
reads even more like math:<p><pre><code>  gcd(A, B) when B == 0 -&gt; A;
  gcd(A, B) when A &lt; B  -&gt; gcd(B, A);
  gcd(A, B)             -&gt; gcd(B, A rem B).
</code></pre>
I also really appreciated the posting of more of Dijkstra&#x27;s
thoughts (from rer0tsaz) above, in particular this line struck a chord:<p><pre><code>  When programming languages emerged, the &quot;dynamic&quot; nature of
  the assignment statement did not seem to fit too well into the
  &quot;static&quot; nature of traditional mathematics.
  </code></pre>
(Along those lines, Erlang&#x27;s recasting of the equals sign as a
pattern matching operator felt so natural when I learned how it
worked.)<p>[Edit: zap redundant sentence.]