fork download
  1. (format t "~{~a~%~}"
  2. (loop for (sum . list) = '(1 1)
  3. then (if (<= sum 2014)
  4. (list* (+ sum (car list) 1) (1+ (car list)) list)
  5. (cons (- sum (car (last list))) (nbutlast list)))
  6. if (= sum 2014) collect (reverse list)
  7. until (equal list '(2014))))
Success #stdin #stdout 0.04s 10656KB
stdin
Standard input is empty
stdout
(12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64)
(97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115)
(502 503 504 505)
(2014)