Part of the series

Several example codes

~1 min read • Updated Oct 12, 2025

Program Overview

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.


Python Code:


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.")

Sample Output:


No such number found.

Written & researched by Dr. Shahin Siami