login
A339663
Number of nonempty subsets of divisors of n whose average is an integer.
4
1, 2, 3, 4, 3, 9, 3, 7, 6, 6, 3, 24, 3, 7, 13, 12, 3, 27, 3, 22, 11, 7, 3, 72, 6, 6, 12, 21, 3, 83, 3, 20, 13, 6, 11, 133, 3, 7, 11, 70, 3, 82, 3, 21, 38, 7, 3, 230, 7, 14, 13, 23, 3, 88, 11, 65, 11, 6, 3, 763, 3, 7, 35, 36, 11, 84, 3, 22, 13, 73, 3, 780, 3, 6, 37, 20, 11, 82, 3, 228
OFFSET
1,2
EXAMPLE
a(16) = 12 subsets: {1}, {2}, {4}, {8}, {16}, {2, 4}, {2, 8}, {2, 16}, {4, 8}, {4, 16}, {8, 16} and {1, 4, 16}.
PROG
(PARI)
sumbybits(v, b) = { my(s=0, i=1); while(b>0, s += (b%2)*v[i]; i++; b >>= 1); (s); };
A339663(n) = { my(ds=divisors(n), u=#ds); sum(m=1, (2^u)-1, !(sumbybits(ds, m)%hammingweight(m))); }; \\ Antti Karttunen, Dec 12 2021
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 11 2020
STATUS
approved