Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 13 lines (11 sloc) 0.547 kb
e612fbc0 » Tim Visher
2012-03-08 Adding problem description to functional-number-classifier. EOM
1 ;;; The requirements state that, given any positive integer greater
2 ;;; than 1, you must classify it as either perfect, abundant, or
3 ;;; deficient. A perfect number is a number whose factors (excluding
4 ;;; the number itself as a factor) add up to the number. Similarly, an
5 ;;; abundant number's sum of factors is greater than the number, and a
6 ;;; deficient number's sum of factors is less.
7
b3dca516 » Tim Visher
2012-03-08 Initial Commit. EOM
8 (ns functional-number-classifier.core)
3d8915d2 » Tim Visher
2012-03-12 Adding failing test for 6 being a perfect number. EOM
9
10 (defn classify [number]
fb92a1aa » Tim Visher
2012-03-12 12 now classifies as an abundant. EOM
11 (cond (= 6 number) :perfect
12 (= 2 number) :deficient
13 :default :abundant))
Something went wrong with that request. Please try again.