for number in range(125873, 136763):
divisors = []
for divisor in range(2, number // 2 + 1):
if number % divisor == 0:
n = divisor
divisors.append(divisor)
for _ in range(3):
n *= divisor
divisors.append(n)
if n == number:
print(f'число = {number}, делители = 1, {", ".join(str(s) for s in divisors)}')
break
ищет 40 сек
for j in range(125873, 136763):
count = []
for i in range(2, j // 2 +1):
if j % i == 0:
count.append(i)
if len(count) > 3:
if len(count) == 3:
print(f'число = {j}, делители = 1, {", ".join(str(s) for s in count)}, {j}')
count.clear()
Объяснение:
for number in range(125873, 136763):
divisors = []
for divisor in range(2, number // 2 + 1):
if number % divisor == 0:
n = divisor
divisors.append(divisor)
for _ in range(3):
n *= divisor
divisors.append(n)
if n == number:
print(f'число = {number}, делители = 1, {", ".join(str(s) for s in divisors)}')
break
ищет 40 сек
for j in range(125873, 136763):
count = []
for i in range(2, j // 2 +1):
if j % i == 0:
count.append(i)
if len(count) > 3:
break
if len(count) == 3:
print(f'число = {j}, делители = 1, {", ".join(str(s) for s in count)}, {j}')
count.clear()
Объяснение: