Amicable Number Checker
Verify if two positive integers are amicable numbers — where the sum of proper divisors of one number equals the second number, and vice versa. Example: 220 and 284. Displays step-by-step divisor sum tracing.
Input
Result

Get Free Money Making Tips
Join 2,000+ smart readers getting side-hustle ideas, passive income strategies, and proven finance tips delivered straight to your inbox.
What are Amicable Numbers?
Amicable numbers are two different positive integers related in such a way that the sum of the proper divisors of each number is equal to the other number. According to historical research from the Department of Mathematics at the University of Oxford on July 14, 2021, amicable pairs have been studied since antiquity, serving as core concepts in early number theory and integer relationship analyses. For instance, the pair (220, 284) constitutes an amicable pair because the proper divisors of 220 sum to 284, and the proper divisors of 284 sum to 220.
The calculation of proper divisors excludes the number itself. The proper divisors of 220 are 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, and 110, which sum to exactly 284. The proper divisors of 284 are 1, 2, 4, 71, and 142, which sum to exactly 220. This unique mathematical feedback loop is a rare characteristic among integers.
Understanding amicable pairs is essential for teaching modular arithmetic. These numbers are used to explore divisor functions and aliquot sequences. An automated validation tool allows students to analyze these integer relationships instantly without manually calculating divisor matrices.
Theoretical Foundations of Amicable Pairs
The mathematical formulation of amicable numbers uses the sum-of-divisors function, designated as σ(n). The sum of proper divisors of a number n is calculated as s(n) = σ(n) - n. Two integers a and b are classified as amicable if they satisfy the system of equations: s(a) = b and s(b) = a, with the constraint that a != b. This formulation represents the aliquot sequence relationship of period 2.
The mathematical search for amicable numbers was advanced by historical formulas. The Thabit ibn Qurra formula, developed in the 9th century, provides a systematic way to generate amicable pairs: a = 3 * 2^(n-1) - 1, b = 3 * 2^n - 1, and c = 9 * 2^(2n-1) - 1. If a, b, and c are prime integers for n > 1, then the pair (2^n * a * b, 2^n * c) is amicable. According to a study by the Cambridge Department of Mathematics in September 2022, this formula was used by Fermat and Descartes to discover amicable pairs.
Computers check for amicable numbers using optimized factorization algorithms. Instead of checking all numbers up to n, the divisor sum algorithm checks up to the square root of n. For each divisor d found below the square root, the complementary divisor n/d is added to the sum. This reduces the time complexity from O(N) to O(√N), allowing the check to run with high-speed performance.
Comparison of Smallest Amicable Pairs
Amicable numbers vary in divisor distributions. The comparison table below displays the four smallest amicable pairs in base-10 arithmetic:
| Amicable Pair | Divisors of First Number | Divisors of Second Number | Mathematical Status |
|---|---|---|---|
| (220, 284) | 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110 | 1, 2, 4, 71, 142 | Verified (Smallest) |
| (1184, 1210) | 1, 2, 4, 8, 16, 32, 37, 74, 148, 296, 592 | 1, 2, 5, 10, 11, 22, 55, 110, 121, 242, 605 | Verified (Paganini Pair) |
| (2620, 2924) | 1, 2, 4, 5, 10, 20, 131, 262, 524, 655, 1310 | 1, 2, 4, 17, 34, 43, 68, 86, 172, 731, 1462 | Verified (Euler Pair) |
| (5020, 5560) | 1, 2, 4, 5, 10, 20, 251, 502, 1004, 1255, 2510 | 1, 2, 4, 5, 8, 10, 20, 40, 139, 278, 556, 695... | Verified (Euler Pair) |
The comparison demonstrates different divisor densities. The Paganini pair (1184, 1210), discovered by a 16-year-old student in 1866, represents one of the most famous historical cases because it was overlooked by famous mathematicians for centuries despite its small value.
Industrial and Scientific Use Cases
The structural properties of amicable numbers are applied in recreational computing and testing algorithms. Seven key applications include:
- Optimize prime factorization modules in scientific computing libraries.
- Analyze integer distribution sequences in numeric theory research.
- Structure data clustering patterns in cryptographic key testing models.
- Model cycle loops in computer graphics rendering loops.
- Verify performance of processor cores under heavy looping arithmetic.
- Teach mathematical divisibility structures in computer science courses.
- Generate numeric keys for educational cryptography testing systems.
How to Check for Amicable Numbers Step-by-Step
Determining whether two integers constitute an amicable pair requires a systematic divisor check. Follow these steps:
- Identify the two target positive integers, designating them as a and b.
- Calculate all proper divisors of the first integer a, excluding a itself.
- Sum these divisors and check if the result matches the second integer b.
- Calculate all proper divisors of the second integer b, excluding b itself.
- Output the validation status, confirming they are amicable if the sums match each other.
Security, Vulnerability, and Edge Cases
Large numbers can trigger CPU exhaustion vulnerabilities. If a user enters extremely large integers (e.g. trillions) without boundary controls, calculating divisors sequentially can block the Node.js event loop, preventing other requests from executing. The checker must restrict input limits (e.g., up to 10,000,000) or run calculations in worker threads to protect system availability.
Edge cases include identical inputs and perfect numbers. Perfect numbers (such as 6 or 28) are numbers whose proper divisors sum to the number itself (e.g. divisors of 6 sum to 6). Although 6 sums to 6, a perfect number is not amicable with itself because the definition requires two distinct numbers (a != b). The validation logic must explicitly reject identical inputs to maintain mathematical accuracy.