Special Number Detector

数字输入

Example Numbers:

检测结果

输入数字后点击"开始检测"

Explanation of Special Numbers:

1. Perfect Number:
完全数是指所有真因子(即除了自身以外的正因子)之和等于它本身的正整数。
σ(n) = 2n,其中 σ(n) 是 n 的所有因子(包括自身)之和
  • Examples:6 = 1 + 2 + 3 (Divisors: 1, 2, 3)
  • Examples:28 = 1 + 2 + 4 + 7 + 14 (Divisors: 1, 2, 4, 7, 14)
  • Known Perfect Numbers:6, 28, 496, 8128, 33550336...
  • Euclid-Euler Theorem:If 2^p - 1 is a prime number (a Mersenne prime), then 2^(p-1) × (2^p - 1) is a perfect number.
  • Unsolved Mystery:Do odd perfect numbers exist? None have been found so far.
2. Amicable Numbers:
友好数是一对数字,其中每个数的真因子之和等于另一个数。
σ(a) - a = b 且 σ(b) - b = a,其中 a ≠ b
  • Examples:220 and 284 are amicable numbers
  • Proper divisors of 220: 1, 2, 4, 5, 10, 11, 20, 22, 44, 55, 110, sum to 284
  • Proper divisors of 284: 1, 2, 4, 71, 142, sum to 220
  • Other amicable pairs:(1184, 1210), (2620, 2924), (5020, 5564)...
  • History:The Pythagorean school knew about the amicable pair 220 and 284 as early as the 6th century BC
3. Armstrong Numbers (Armstrong Number / Narcissistic Number):
阿姆斯特朗数是指一个 k 位数,它的每个位上的数字的 k 次幂之和等于它本身。
n = d₁^k + d₂^k + ... + dₖ^k,其中 k 为数字位数
  • 1-digit numbers:0, 1, 2, 3, 4, 5, 6, 7, 8, 9 (all single-digit numbers are Armstrong numbers)
  • 3-digit numbers:153 = 1³ + 5³ + 3³ = 1 + 125 + 27
  • 3-digit numbers:370 = 3³ + 7³ + 0³ = 27 + 343 + 0
  • 3-digit numbers:371 = 3³ + 7³ + 1³ = 27 + 343 + 1
  • 3-digit numbers:407 = 4³ + 0³ + 7³ = 64 + 0 + 343
  • 4-digit numbers:1634 = 1⁴ + 6⁴ + 3⁴ + 4⁴ = 1 + 1296 + 81 + 256
  • 4-digit numbers:8208, 9474
  • Total count:There are only finitely many Armstrong numbers (88 known)

Algorithm complexity:

  • Perfect number detection:O(√n) - requires finding all factors
  • Amicable number detection:O(√n) - requires calculating the sum of proper divisors and checking pairs
  • Armstrong Number Detection:O(k) - k is the number of digits, each digit needs to be processed

Notes:

  • Perfect numbers are extremely rare; only 51 have been discovered so far (as of 2024)
  • Friendly number detection may take a long time for large numbers because it requires calculating the sum of factors
  • Armstrong number detection is relatively fast, but the total count is limited
  • 1 is not considered a perfect number, even though the sum of its proper divisors is 0