If there was latex support on the forums, perhaps I would understand the algorithm you are using better. Lol.... seriously though, I will be back shortly. I am not sure how your algorithm even correctly determines if a number is perfect, to be perfectly honest. Perfect numbers are rare anyway, so its not like it comes up very often.