Friendly Numbers Checker

Input two numbers to check if they are friendly numbers.

Friendly Numbers Check

Result

What Are Friendly Numbers?

Friendly numbers** are pairs of positive integers \( A \) and \( B \) where the ratio of the sum of their divisors to the number itself is the same. Mathematically, this relationship is expressed as: \( \frac{S(A)}{A} = \frac{S(B)}{B} \) Here, \( S(n) \) represents the sum of all positive divisors of \( n \), including \( n \) itself.

How to Check if Two Numbers Are Friendly

  1. Calculate the sum of divisors: Determine the sum of divisors for both \( A \) and \( B \), denoted as \( S(A) \) and \( S(B) \).
  2. Compute the ratio: Divide each sum of divisors by its respective number to calculate \(\frac{S(A)}{A}\) and \(\frac{S(B)}{B}\).
  3. Compare the ratios: If the ratios are equal, \( A \) and \( B \) are friendly numbers. Otherwise, they are not.

Examples

Example 1: Are 6 and 28 Friendly Numbers?

Solution:

Divisors of 6: \( 1, 2, 3, 6 \); \( S(6) = 12 \).

Divisors of 28: \( 1, 2, 4, 7, 14, 28 \); \( S(28) = 56 \).

Compute the ratios:

\(\frac{S(6)}{6} = \frac{12}{6} = 2\)

\(\frac{S(28)}{28} = \frac{56}{28} = 2\)

Result: Since the ratios are equal, 6 and 28 are friendly numbers.

Example 2: Are 10 and 20 Friendly Numbers?

Solution:

Divisors of 10: \( 1, 2, 5, 10 \); \( S(10) = 18 \).

Divisors of 20: \( 1, 2, 4, 5, 10, 20 \); \( S(20) = 42 \).

Compute the ratios:

\(\frac{S(10)}{10} = \frac{18}{10} = 1.8\)

\(\frac{S(20)}{20} = \frac{42}{20} = 2.1\)

Result: Since the ratios are not equal, 10 and 20 are not friendly numbers.