login
A390834
The maximum number of proper divisors of a semiperfect number k that sum to k.
3
3, 4, 4, 4, 6, 5, 5, 6, 6, 4, 7, 5, 6, 8, 5, 8, 3, 7, 9, 6, 9, 9, 5, 3, 6, 8, 7, 3, 12, 9, 9, 3, 8, 10, 7, 9, 8, 6, 12, 3, 7, 14, 3, 10, 7, 9, 9, 6, 7, 12, 12, 9, 3, 10, 7, 10, 15, 3, 14, 3, 8, 11, 13, 6, 7, 13, 3, 14, 7, 13, 7, 7, 8, 12, 3, 10, 11, 12, 15, 7
OFFSET
1,1
LINKS
FORMULA
If A005835(n) is a perfect number then a(n) = A032741(A005835(n)).
EXAMPLE
A005835(17) = 78 = 39 + 26 + 13, and no other subset of {1, 2, 3, 6, 13, 26, 39} sums to 78, so a(17) = 3.
A005835(34) = 144 = 1 + 2 + 3 + 4 + 6 + 8 + 12 + 24 + 36 + 48, and no other subset of {1, 2, 3, 4, 6, 8, 9, 12, 16, 18, 24, 36, 48, 72} that sums to 144 has more terms, so a(34) = 10.
MAPLE
# after obtaining a list of semiperfect numbers SP
f:= proc(n) local k, D, d, x; uses Optimization, NumberTheory;
k:= SP[n];
D:= Divisors(k) minus {k};
LPSolve(add(x[d], d=D), {add(d*x[d], d=D) = k}, maximize, assume=binary, depthlimit=1000)[1];
end proc:
map(f, [$1..nops(SP)]); # Robert Israel, Jan 07 2026
PROG
(Python)
from sympy import proper_divisors
def max_divs(n: int) -> int:
if n <= 1: return -1
dp = {0: 0}
for d in proper_divisors(n):
n_dp = dict(dp)
for s, count in dp.items():
n_sum = s + d
if n_sum <= n:
n_dp[n_sum] = max(n_dp.get(n_sum, -1), count + 1)
dp = n_dp
return dp.get(n, -1)
print([a for n in range(1, 400) if (a := max_divs(n)) > 0]) # Peter Luschny, Jan 08 2026
CROSSREFS
KEYWORD
nonn
AUTHOR
Peter Luschny, Nov 25 2025
EXTENSIONS
Corrected by Robert Israel, Jan 07 2026
STATUS
approved