ONLY DO WHAT ONLY YOU CAN DO

こけたら立ちなはれ 立ったら歩きなはれ

Project Euler Problem 9

ピタゴラス数(ピタゴラスの定理を満たす自然数)とは で以下の式を満たす数の組である.

例えば, である.
となるピタゴラスの三つ組が一つだけ存在する.
これらの積を計算しなさい.

A Pythagorean triplet is a set of three natural numbers,, for which,

For example, .
There exists exactly one Pythagorean triplet for which.
Find the product .

考え方

なので

これを
に代入して





この式を満たす、a, b を探す