<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>inamori</author_name>
  <author_url>https://blog.hatena.ne.jp/inamori/</author_url>
  <blog_title>inamori’s diary</blog_title>
  <blog_url>https://inamori.hateblo.jp/</blog_url>
  <categories>
    <anon>プログラミング</anon>
    <anon>Python</anon>
  </categories>
  <description>Problem 1322, 3, 5以外の素数を列挙します。A(p)（すなわちB(p)）が109を割り切る素数pを列挙すればよいです。109を割り切るかどうかの判定は比較的簡単です。まず、p - 1の2と5の成分を取り出します。例えばp = 1920001として、p - 1 = 210 * 3 * 54だから、2は10個、5は4個です。9との小さい方を取って、e = 29 * 54が、 10e ≡ 1(mod p) を満たせば、B(p)はeの約数だから109を割り切ることになります。逆も明らかです。 40個で0.09s、70個で36sでした。</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Finamori.hateblo.jp%2Fentry%2F20120414%2Fp1&quot; title=&quot;Project Euler 132 - inamori’s diary&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>2012-04-14 00:00:00</published>
  <title>Project Euler 132</title>
  <type>rich</type>
  <url>https://inamori.hateblo.jp/entry/20120414/p1</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
