func perfect(n:Int) -> Bool { var sum = 0 for i in 1..