OFFSET
1,2
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 1..200
FORMULA
EXAMPLE
For n = 5, a(5) = 1 + 5 + 6 = 12 (each of the numbers 1, 5 and 6 is the sum of a subset of distinct divisors of 5).
The numbers n = 14 and 15 is an interesting pair of consecutive numbers with identical value of sigma(n) such that simultaneously a(14) = a(15) and A237289(14) = A237289(15).
a(14) = 1+2+3+7+8+9+10+14+15+16+17+21+22+23+24 = a(15) = 1+3+4+5+6+8+9+15+16+18+19+20+21+23+24 = 192.
MAPLE
isSumDist := proc(n, k)
local dvs, s ;
dvs := numtheory[divisors](n) ;
for s in combinat[powerset](dvs) do
add(m, m=op(s)) ;
if % = k then
return true;
end if;
end do:
false ;
end proc:
A237290 := proc(n)
local a;
a := 0 ;
for k from 1 to numtheory[sigma](n) do
if isSumDist(n, k) then
a := a+k;
end if;
end do:
end proc:
seq(A237290(n), n=1..20) ; # R. J. Mathar, Mar 13 2014
MATHEMATICA
a[n_] := Plus @@ Union[Plus @@@ Subsets@ Divisors@ n]; Array[a, 54] (* Giovanni Resta, Mar 13 2014 *)
PROG
(PARI) padbin(n, len) = {b = binary(n); while(length(b) < len, b = concat(0, b); ); b; }
a(n) = {vks = []; d = divisors(n); nbd = #d; for (i=1, 2^nbd-1, b = padbin(i, nbd); onek = sum(j=1, nbd, d[j]*b[j]); vks = Set(concat(vks, onek)); ); sum(i=1, #vks, vks[i]); } \\ Michel Marcus, Mar 09 2014
(Python)
from sympy import divisors
def A237290(n):
ds = divisors(n)
c, s = {0}, sum(ds)
for d in ds:
c |= {a+d for a in c}
return sum(a for a in c if 1<=a<=s) # Chai Wah Wu, Jul 05 2023
CROSSREFS
KEYWORD
nonn
AUTHOR
Jaroslav Krizek, Mar 02 2014
STATUS
approved