

A339665


Number of nonempty subsets of divisors of n whose harmonic mean is an integer.


6



1, 2, 2, 3, 2, 9, 2, 4, 3, 4, 2, 17, 2, 4, 6, 5, 2, 19, 2, 10, 4, 4, 2, 37, 3, 4, 4, 12, 2, 45, 2, 6, 4, 4, 4, 57, 2, 4, 4, 28, 2, 29, 2, 6, 16, 4, 2, 85, 3, 6, 4, 6, 2, 35, 4, 23, 4, 4, 2, 301, 2, 4, 6, 7, 4, 28, 2, 6, 4, 19, 2, 255, 2, 4, 10, 6, 4, 20, 2, 61
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

1,2


LINKS



EXAMPLE

a(6) = 9 subsets: {1}, {2}, {3}, {6}, {2, 6}, {3, 6}, {1, 3, 6}, {2, 3, 6} and {1, 2, 3, 6}.


MATHEMATICA

a[n_] := Count[Subsets[Divisors[n]], _?(Length[#] > 0 && IntegerQ[HarmonicMean[#]] &)]; Array[a, 100] (* Amiram Eldar, Nov 09 2021 *)


PROG

(PARI) h(s, d) = #s/sum(k=1, #s, 1/d[s[k]]);
a(n) = my(d=divisors(n), nb=0); forsubset(#d, s, if (#s && (denominator(h(s, d))==1), nb++)); nb; \\ Michel Marcus, Dec 15 2020
(Python)
from itertools import combinations
from sympy import divisors
ds = tuple(divisors(n, generator=True))
return sum(sum(1 for d in combinations(ds, i) if n*i % sum(d) == 0) for i in range(1, len(ds)+1)) # Chai Wah Wu, Nov 09 2021


CROSSREFS



KEYWORD

nonn


AUTHOR



STATUS

approved



