This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.
%I A339665 #42 Feb 16 2025 08:34:01 %S A339665 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, %T A339665 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, %U A339665 4,6,7,4,28,2,6,4,19,2,255,2,4,10,6,4,20,2,61 %N A339665 Number of nonempty subsets of divisors of n whose harmonic mean is an integer. %H A339665 Chai Wah Wu, <a href="/A339665/b339665.txt">Table of n, a(n) for n = 1..3000</a> %H A339665 Eric Weisstein's World of Mathematics, <a href="https://mathworld.wolfram.com/HarmonicMean.html">Harmonic Mean</a> %H A339665 <a href="/index/Di#divisors">Index entries for sequences related to divisors of numbers</a> %e A339665 a(6) = 9 subsets: {1}, {2}, {3}, {6}, {2, 6}, {3, 6}, {1, 3, 6}, {2, 3, 6} and {1, 2, 3, 6}. %t A339665 a[n_] := Count[Subsets[Divisors[n]], _?(Length[#] > 0 && IntegerQ[HarmonicMean[#]] &)]; Array[a, 100] (* _Amiram Eldar_, Nov 09 2021 *) %o A339665 (PARI) h(s, d) = #s/sum(k=1, #s, 1/d[s[k]]); %o A339665 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 %o A339665 (Python) %o A339665 from itertools import combinations %o A339665 from sympy import divisors %o A339665 def A339665(n): %o A339665 ds = tuple(divisors(n, generator=True)) %o A339665 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 %Y A339665 Cf. A027750, A100587, A339453, A339663, A339664, A339666. %K A339665 nonn %O A339665 1,2 %A A339665 _Ilya Gutkovskiy_, Dec 11 2020