-1

A perfect number is one for which the sum of its divisors (excluding the number) is equal to the number itself. For examples 6 is perfect since the three divisors of 6 (excluding 6) are 1, 2, and 3 which add up to 6. The number 8 however has divisors 1, 2, 4 which add up to 7 so 8 is not perfect.

Write a Java program that will determine and print the first 4 perfect numbers one per line.