OFFSET
1,2
LINKS
Antti Karttunen, Table of n, a(n) for n = 1..16384 (first 500 terms from Jaroslav Krizek)
Maxwell Schneider and Robert Schneider, Digit sums and generating functions, arXiv:1807.06710 [math.NT], 2018. See (22) p. 6.
FORMULA
a(n) = Sum_{k = 0..n} if(mod(n, k) = 0, A000120(k), 0). - Paul Barry, Jan 14 2005
From Bernard Schott, May 16 2022: (Start)
a(2^n) = n+1 (End)
EXAMPLE
a(8) = 4 because the divisors of 8 are [1, 2, 4, 8] and in binary: 1, 10, 100, 1000, so four 1's.
MAPLE
a:= n-> add(add(i, i=Bits[Split](d)), d=numtheory[divisors](n)):
seq(a(n), n=1..100); # Alois P. Heinz, May 17 2022
MATHEMATICA
Table[Plus@@DigitCount[Divisors[n], 2, 1], {n, 75}] (* Alonso del Arte, Sep 01 2013 *)
PROG
(PARI) A093653(n) = sumdiv(n, d, hammingweight(d)); \\ Antti Karttunen, Dec 14 2017
(PARI) a(n) = {my(v = valuation(n, 2), n = (n>>v)); sumdiv(n, d, hammingweight(d)) * (v + 1)} \\ David A. Corneth, Feb 15 2023
(Python)
from sympy import divisors
def a(n): return sum(bin(d).count("1") for d in divisors(n))
print([a(n) for n in range(1, 88)]) # Michael S. Branicky, Apr 20 2022
(Python)
from sympy import divisors
def A093653(n): return sum(d.bit_count() for d in divisors(n, generator=True))
print([A093653(n) for n in range(1, 88)]) # Michael S. Branicky, Feb 15 2023
CROSSREFS
KEYWORD
base,easy,nonn
AUTHOR
Jason Earls, May 16 2004
STATUS
approved