<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<oembed>
  <author_name>keisukefukuda</author_name>
  <author_url>https://blog.hatena.ne.jp/keisukefukuda/</author_url>
  <blog_title>本当は怖いHPC &amp; AI</blog_title>
  <blog_url>https://freak-da.hatenablog.com/</blog_url>
  <categories>
  </categories>
  <description>うーん、数学的な工夫をあまり思いつかなかったのだが、とりあえず効果のあった高速化は次の2つ。 - 計算の上限を設定。これは、計算してみればわかるが明らかに 6 * 9^5 である。各桁の5乗の和というのは、どうがんばっても6桁のこの数以上にはならないことがわかる。だから6桁以下で計算すればよいのだが、単純に - 計算結果の再利用。例えば、各桁の五乗を求める関数をf(n)とすると、 f(n) = f(n/10) + (n%10)^5 だから、f(n/10)部分の計算はキャッシュして再利用できる。これを使うと、手元のPCで1.3秒くらい。むむむ。まぁこれで満足すべきなのかな。てかこの問題こそGPU…</description>
  <height>190</height>
  <html>&lt;iframe src=&quot;https://hatenablog-parts.com/embed?url=https%3A%2F%2Ffreak-da.hatenablog.com%2Fentry%2F20101211%2Fp3&quot; title=&quot; Project Euler Problem 30 - 本当は怖いHPC &amp;amp; AI&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>2010-12-11 00:00:03</published>
  <title> Project Euler Problem 30</title>
  <type>rich</type>
  <url>https://freak-da.hatenablog.com/entry/20101211/p3</url>
  <version>1.0</version>
  <width>100%</width>
</oembed>
