3 # This file is part of NIT ( http://www.nitlanguage.org ).
4 # This program is public domain
6 # Task: Perfect numbers
7 # SEE: <http://rosettacode.org/wiki/Perfect_Numbers>
12 fun isPerfect
(x
: Int): Bool
15 for i
in [1..(x-1
)] do
16 if x
%i
== 0 then sum
= sum
+i