2010-07-28から1日間の記事一覧

Project Euler 138

http://projecteuler.net/index.php?section=problems&id=138 (b / 2, h, L)でピタゴラス数で、hが偶数だとhとbの差が偶数になってしまうので、 h = m2 - n2 b = 4mn L = m2 + n2 m2 - n2 - 4mn = ±1 (m - 2n)2 - 5n2 = ±1 これもペル方程式です。