(ns narcissistic.core
  (:require [clojure.math.numeric-tower:as math]))

(defn digits [n] 
  (->> n str (map (comp read-string str))))

(defn narcissistic? [n] 
  (let [d (digits n)
        s (count d)]
    (= n (reduce + (map #(math/expt % s) d)))))

(defn firstNnarc [n] 
  (take n (filter narcissistic? (range))))