2026-07-22

Problem — 2026-07-22

Medium

MediumNumber theory

A cryptographer designs a security system where valid passcodes are 6-digit numbers (leading zeros allowed) with the property that when you compute the sum of all divisors of the number (including 1 and the number itself), the result is exactly twice the original number. For example, 6 works because its divisors {1,2,3,6} sum to 12 = 2×6. How many valid 6-digit passcodes exist in this system?

Enter a whole number

Show solution
We need to find 6-digit perfect numbers (numbers equal to the sum of their proper divisors, or equivalently, where σ(n) = 2n). The known perfect numbers are: - 6 = 2¹(2² - 1) - 28 = 2²(2³ - 1) - 496 = 2⁴(2⁵ - 1) - 8128 = 2⁶(2⁷ - 1) - 33550336 = 2¹²(2¹³ - 1) For 6-digit numbers, we need 100000 ≤ n ≤ 999999. Checking our list: - 6: only 1 digit ✗ - 28: only 2 digits ✗ - 496: only 3 digits ✗ - 8128: only 4 digits ✗ - 33550336: has 8 digits ✗ However, the problem says "6-digit numbers (leading zeros allowed)". This means we're looking at representations from 000000 to 999999. The perfect numbers in this range written with leading zeros: - 000006 - 000028 - 000496 - 008128 All four of these are valid 6-digit passcodes when we allow leading zeros. The next perfect number (33550336) exceeds 999999, so we have exactly **4** valid passcodes.