The OEIS mourns the passing of Jim Simons and is grateful to the Simons Foundation for its support of research in many branches of science, including the OEIS.
login
The OEIS is supported by the many generous donors to the OEIS Foundation.

 

Logo
Hints
(Greetings from The On-Line Encyclopedia of Integer Sequences!)
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
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
Sequence in context: A369748 A280583 A177047 * A334490 A016001 A016012
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 11 2020
STATUS
approved

Lookup | Welcome | Wiki | Register | Music | Plot 2 | Demos | Index | Browse | More | WebCam
Contribute new seq. or comment | Format | Style Sheet | Transforms | Superseeker | Recents
The OEIS Community | Maintained by The OEIS Foundation Inc.

License Agreements, Terms of Use, Privacy Policy. .

Last modified June 12 18:11 EDT 2024. Contains 373359 sequences. (Running on oeis4.)