<?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>素因数分解は結局素数で順に割っていくしかないのだけれど、素数をわざわざ求めてというのは却って大変ですね。うまいやり方としては、2 および 3 以上の奇数で割るという方法があります。これは多少のムダは出るけど、全部の数で割るより効率的ですね。さらにうまいやり方があって、2, 3 以上は 5, 7, 11, 13, 17, 19, 23, 25, 29 .... と、ステップ幅を 2 と 4 の交代にして割っていくという方法があります。かしこいですね。これは例えば Ruby でこんなふうに書けます。 prime_factorize.rb def prime_factorize(n) if n &lt;=…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Fobelisk.hatenablog.com%2Fentry%2F2018%2F03%2F25%2F165645&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>https://images-fe.ssl-images-amazon.com/images/I/51ZXNYW1EDL._SL160_.jpg</image_url>
  <provider_name>Hatena Blog</provider_name>
  <provider_url>https://hatena.blog</provider_url>
  <published>2018-03-25 16:56:45</published>
  <title>素因数分解（Ruby）</title>
  <type>rich</type>
  <url>https://obelisk.hatenablog.com/entry/2018/03/25/165645</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
