Problem 75

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

普通に数える。

import Data.List
pythagoras l = [2*m*(m+n)|m<-[1..floor.sqrt.fromInteger.div l$2],
n<-[1..min m$div l (2*m) - m],gcd m n ==1,even m || even n]
p075 l = length.concat.filter((==1).length).group.sort.concatMap sequ.pythagoras$l
where sequ n = takeWhile(<=l).iterate (n+)$ n
main = print.p075$2*10^6
More Reading
Older// Problem 76