I am making an algorithm with python to find perfect numbers up to 100000000000000. I have created some code for this that should do it, and it does not throw up any errors, but the code just outputted nothing and is running continuously. I have checked, and the first perfect number is six, so why is my program taking so long to get there?
Here is my code:
number = 1
divisor = 2
factors = 1
if number < 100000000000000:
while True:
number2 = number/divisor
if isinstance(number2, int):
factors = factors + divisor + number2
divisor = divisor + 1
if divisor == number:
if factors == number:
print(number)
number = number + 1
break