def perfect( n ) = sum( d | d <- 1..n if d|n ) == 2n println( (1..500).filter(perfect) )