Skip to content

Instantly share code, notes, and snippets.

@johnwalker
Created October 27, 2013 17:01
Show Gist options
  • Save johnwalker/7185015 to your computer and use it in GitHub Desktop.
Save johnwalker/7185015 to your computer and use it in GitHub Desktop.
Incomplete
(ns ieee2013.binpalindromes)
(defn log2up [x]
(int (Math/ceil (/ (Math/log x)
(Math/log 2)
2))))
(defn problem []
(let [[lower upper]
(mapv #(. Integer parseInt %)
(clojure.string/split (read-line) #","))]
(println (apply - (map #(Math/pow % 0.5) [upper lower])))))
(problem)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment