28問目
http://projecteuler.net/index.php?section=problems&id=28
1辺が1001の正方形に螺旋状に並んだ数字のうち、対角線にあるものの和を求める。
main = print $ euler028 1001 euler028 :: Int -> Int euler028 n = sum $ map calc [1,3..n] calc :: Int -> Int calc 1 = 1 calc n = (n ^ 2) * 4 - (n - 1) * 6