Factors of an integer: Difference between revisions

No edit summary
Line 25:
 
=={{header|Clojure}}==
 
{{incorrect|Clojure|It needs to include the number itself in the list of factors; right now it is only producing the '''proper divisors''' of the number, which is not quite right.}}
<lang lisp>(defn factors [n]
(filter #(zero? (rem n %)) (range 1 (inc n))))
 
(print (factors 45))</lang>
(1 3 5 9 15 45)
 
=={{header|Common Lisp}}==
Anonymous user