            ;; by (fac(n))^2
            (Math/pow (factorial n) 2))))
 
-(defn triangle [n]
+(defn triangle
   "**triangle :: Int -> Int**
   Computes the nth triangle number.
   A triangle number is generated by adding the natural numbers up to n.
   Shortcut using Gauss technique."
-  (/ (* n (inc n)) 2))
+  [n] (/ (* n (inc n)) 2))
 
 (def fibs
   "**fibs :: [Int]**
   Lazy sequence of all Fibonacci numbers. Using BigIntegers."
   (lazy-cat [0N 1N] (map + (rest fibs) fibs)))
 
-(defn next-collatz [n]
+(defn next-collatz
   "computes the next number of the collatz sequence."
-  (if (even? n) (bit-shift-right n 1) (inc (* 3 n))))
-
-(defn collatz [n]
+  [n] (if (even? n) (bit-shift-right n 1) (inc (* 3 n))))
+
+(defn collatz
   "**collatz :: [Int]**
   Lazy seq of Collatz sequence of n."
-  (cons n
+  [n] (cons n
         (if (= n 1) '()
             (collatz (next-collatz n)))))
 


(def tens ["twenty" "thirty" "forty" "fifty" "sixty" "seventy" "eighty" "ninety"])

(defn to-words [n]
  "Converts a number (up to 1000) into its string representation, omitting spaces.
  Example: (to-words 115) => 'onehundredandfifteen'."
  (cond
    (< n 20) (nth singles (dec n))
    (< n 100) (if (factor? n 10)

           (map inc)
           (reduce *)))

(defn palindrome?
  "**palindrome? :: Int -> Bool**
  Checks whether the given number n is a palindrome.
  Uses reversed string comparison"
  [n] (= (str n) (clojure.string/reverse (str n))))

(defn least-common-multiple
  "**least-common-multiple :: [Int] -> Int**
  Computes the smallest number divisible by all of the given input numbers."
  [input]
  (->> input
       (map #(frequencies (get-primes %)))
       (apply merge-with max)
