In the interest of greater openness (sharing my inner life with the world and such), here is a bit of python I just wrote to find perfect numbers. After a few minutes of optimization, it is now quite fast and no longer brings OSX to its knees with memory-hungryness:
from math import * def is_perfect(a): sum = 1 for i in xrange(2, floor(sqrt(a))): if a%i == 0: sum = sum + i + a/i if sqrt(a)%1 == 0: sum += sqrt(a) return sum == a def find_perfect(limit): results = [] for i in xrange(1, limit): j=2**i*(2**(i+1)-1) if is_perfect(j): results.append(j) print j, return results
And is used like:
>>> find_perfect(20) [28, 496, 8128, 33550336, 8589869056L, 137438691328L]
I didn't find any more (after checking to 230×(231-1). This may not be all of the perfect numbers below the limit though, since I borrowed without proof Irvine Kaplanski's suggestion in this lecture that perfect numbers always have the form 2n×(2n+1-1). Perhaps there is a simple proof? Probably not :)

reply
If you're using floating point variables, there's always going to be some issues with accuracy. When you calculate functions like exponents or logs, iterative numerical methods are used. These can get very very close to the right answer, but may not always hit it exactly. This is combined with the issue that some numbers simply can not be fully represented in floating point.
def perfect(i) : return
def perfect(i) : return filter( lambda n: reduce( lambda x,y: x+y, filter( lambda x: n%x==0, range( 1,n ))) == n, range( 2,i ))
http://en.wikipedia.org/wiki/
http://en.wikipedia.org/wiki/Perfect_number
According to wikipedia, Euclid proved that whenever 2n+1-1 is prime, 2n×(2n+1-1) is perfect, and Euler showed that all even perfect numbers are of this form, but neither proof is given. Guess some searching is would be required.
No one has proved that there are no odd perfects, but it is generally thought to be true.