<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>obelisk2</author_name>
  <author_url>https://blog.hatena.ne.jp/obelisk2/</author_url>
  <blog_title>Camera Obscura</blog_title>
  <blog_url>https://obelisk.hatenablog.com/</blog_url>
  <categories>
    <anon>Ruby</anon>
    <anon>数学</anon>
  </categories>
  <description>ユークリッドの互除法（Euclidean Algorithm）を使って、最大公約数を求めます。99400891 と 99221377 の最大公約数は 9973 です。プログラムは以下のとおり。再帰を使う典型的な問題でしょう。 def ea(m, n) return m if n == 0 ea(n, m % n) end puts ea(99400891, 99221377) #=&gt;9973 これを使えば、最小公倍数も簡単に求められます。 def lcml(m, n) m * n / ea(m, n) end puts lcml(48, 28) #=&gt;336 三つ以上の数の最大公約数、最小公倍…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2015%2F10%2F01%2F171623&quot; title=&quot;ユークリッドの互除法を Ruby で - Camera Obscura&quot; class=&quot;embed-card embed-blogcard&quot; scrolling=&quot;no&quot; frameborder=&quot;0&quot; style=&quot;display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;&quot;&gt;&lt;/iframe&gt;</html>
  <image_url></image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2015-10-01 17:16:23</published>
  <title>ユークリッドの互除法を Ruby で</title>
  <type>rich</type>
  <url>https://obelisk.hatenablog.com/entry/2015/10/01/171623</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
