(defn grep-n [n pred coll]
  (-> (comp 
       (map-indexed (fn [i x] (clojure.lang.MapEntry. i x)))
       (xforms/partition (-> n (* 2) inc) 1)
       (filter #(-> % (nth n) val pred))
       cat
       (distinct)
       (map val)
       (remove #{::nil}))
      (sequence (concat (repeat n ::nil) coll (repeat n ::nil)))))