This Python program reads the number 11 and checks all numbers ≤ 11.
It displays those that are both perfect numbers and multiples of 11.
A perfect number is one whose proper divisors sum to the number itself.
def is_perfect(n: int) -> bool:
divisors = [i for i in range(1, n) if n % i == 0]
return sum(divisors) == n
def find_perfect_multiples(limit: int, multiple: int) -> list:
return [i for i in range(1, limit + 1) if i % multiple == 0 and is_perfect(i)]
# Input value
x = 11
results = find_perfect_multiples(x, 11)
if results:
print("Perfect numbers that are multiples of 11:")
for num in results:
print(num)
else:
print("No such number found.")
No such number found.