2010-08-10から1日間の記事一覧
Clojureでやってみるプロジェクトオイラーの29問目と27問目。29問目は「How many distinct terms are in the sequence generated by a^b for 2 ≤ a ≤ 100 and 2 ≤ b ≤ 100?」というもの。 (println (count (distinct (for [a (range 2 101) b (range 2 101)]…
Clojureでやってみるプロジェクトオイラーの29問目と27問目。29問目は「How many distinct terms are in the sequence generated by a^b for 2 ≤ a ≤ 100 and 2 ≤ b ≤ 100?」というもの。 (println (count (distinct (for [a (range 2 101) b (range 2 101)]…