Project Euler 517(3)

http://projecteuler.net/index.php?section=problems&id=517

昨日考えていた高速化を行ったら、4.3秒になった。
もうネタが無い。