Trying to figure out the algotrithm that will find all perfect numbers between 1 and any given int.
A perfect number is defined as: A perfect number is an integer that is equal to the sum of it's divisors as an example 6 is divisible by 1,2 and 3 and 6=1+2+3.

Any help or ideas would be great, thanks.