morris555's diary

高校生のブログです。

2012-05-26から1日間の記事一覧

Problem 12

Problem 12は500個以上の約数を持つ最小の三角数を求める問題です。 import Data.List (group) factorize 1 = [(1, 0)] factorize n = format . factorize' n $ 2:3:[x + y | x <- [6, 12 ..], y <- [-1, 1]] where factorize' n xs'@(x : xs) | n < x * x =…