Created
December 11, 2012 14:50
-
-
Save tnoda/4259078 to your computer and use it in GitHub Desktop.
Project Euler Problem 5 #mitori_clj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(ns tnoda.projecteuler.problem-5 | |
(:import org.apache.commons.math.util.MathUtils) ; [org.apache.commons/commons-math "2.2"] | |
(:use clojure.test)) | |
(defn- solver* | |
[n] | |
(reduce (fn [^long x ^long y] (MathUtils/lcm x y)) (range 1 (inc n)))) | |
(def solver (partial solver* 20)) | |
(is (= 2520 (solver* 10))) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Maven リポジトリ + Leininge で、既存ライブラリを手軽に使えているというのは、ぼくも強く感じています。また、Clojars を使えば、自作ライブラリを公開するのも簡単です。
*warn-on-reflection*
ぼくも試してみます。