OFFSET
1,2
LINKS
Chai Wah Wu, Table of n, a(n) for n = 1..3000
Eric Weisstein's World of Mathematics, Harmonic Mean
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
def A339665(n):
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
Ilya Gutkovskiy, Dec 11 2020
STATUS
approved