for num = 1:1000 if is_perfect(num) disp(num) end end