2010-01-26から1日間の記事一覧

Project Euler 14

http://projecteuler.net/index.php?section=problems&id=14 コラッツ問題。単に1から100万までの長さを求める。 next_collatz n | (mod n 2) == 1 = 3 * n + 1 | otherwise = div n 2collatz_length 1 = 1 collatz_length n = 1 + (collatz_length (next_co…