diff options
Diffstat (limited to 'day1/exercise/aliquot.py')
-rw-r--r-- | day1/exercise/aliquot.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/day1/exercise/aliquot.py b/day1/exercise/aliquot.py new file mode 100644 index 0000000..f07cd77 --- /dev/null +++ b/day1/exercise/aliquot.py @@ -0,0 +1,8 @@ +def aliquot(n): + sum = 0 + for i in range(1, (n/2)+1): + if n % i == 0: + sum += i + return sum + +print aliquot(14) |