[This](http://pizzaforthought.blogspot.in/2014/05/and-infinity-beyond.html) post of mine discusses Thomson's paradox, and simulates it in Clojure.
The `state` function returns the state of the lamp at time = t.

```
(defn thomsons-lamp []
  (iterate (fn [[onoff dur]]
             [(not onoff) (/ dur 2)])
           [true 1])) 

(defn state [t]
  (let [t-vals (map second (thomsons-lamp))]
    (loop [i 1]
      (if (<= t (apply + (take i t-vals)))
        ((comp first last) (take i (thomsons-lamp)))
        (recur (inc i))))))

```

How do I define a cleaner `state` function (preferably without loop/recur)?