OFFSET
1,2
COMMENTS
If the sum of the proper divisors of n exceeds n (i.e., n is abundant), the process cannot be completed and a(n) = 0.
Equivalently, for sigma(n) <= 2n, a(n) is the number of ordered set partitions of [n] into parts of sizes equal to the proper divisors of n together with one additional part of size n minus their sum.
For perfect n, the remainder part has size 0 and a(n) = n!/Product_{d|n, d<n} d!. Thus perfect numbers are exactly those n for which the selection process exhausts [n] without remainder.
LINKS
Felix Huber, Table of n, a(n) for n = 1..1364
FORMULA
a(n) = 0 if sigma(n) > 2*n, otherwise:
a(n) = Product_{i=1..tau(n)-1} binomial(n - Sum_{j=1..i-1} d_j, d_i), where d_1 > ... > d_{tau(n)-1} are the proper divisors of n.
a(n) = n!/((2*n - sigma(n))!*Product_{d|n, d<n} d!).
a(p) = p for primes p.
EXAMPLE
a(6) = binomial(6, 3)*binomial(3, 2)*binomial(1, 1) = 60 (perfect).
a(10) = binomial(10, 5)*binomial(5, 2)*binomial(3, 1) = 7560 (deficient).
a(11) = binomial(11, 1) = 11 (prime).
a(12) = 0 since sigma(12) = 28 > 24 (abundant).
MAPLE
CROSSREFS
KEYWORD
nonn
AUTHOR
Felix Huber, Mar 28 2026
STATUS
approved
