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!)
A357411 Number of nonempty subsets of {1..n} whose elements have an odd harmonic mean. 3
1, 1, 2, 2, 3, 5, 6, 6, 7, 9, 10, 10, 11, 13, 26, 26, 27, 45, 46, 74, 93, 99, 100, 162, 163, 165, 166, 458, 459, 865, 866, 866, 1647, 1669, 2724 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,3
LINKS
FORMULA
a(p) = a(p-1) + 1 for prime p > 2. - Michael S. Branicky, Sep 30 2022
EXAMPLE
a(11) = 10 subsets: {1}, {3}, {5}, {7}, {9}, {11}, {2, 6}, {2, 3, 6}, {3, 6, 10} and {3, 5, 6, 10}.
PROG
(Python)
from fractions import Fraction
from functools import lru_cache
def cond(s, c): h = c/s; return h.denominator == 1 and h.numerator&1
@lru_cache(maxsize=None)
def b(n, s, c):
if n == 0: return int (c > 0 and cond(s, c))
return b(n-1, s, c) + b(n-1, s+Fraction(1, n), c+1)
a = lambda n: b(n, 0, 0)
print([a(n) for n in range(1, 18)]) # Michael S. Branicky, Sep 29 2022
CROSSREFS
Sequence in context: A051732 A098382 A098180 * A270875 A117752 A299775
KEYWORD
nonn,more
AUTHOR
Ilya Gutkovskiy, Sep 27 2022
EXTENSIONS
a(24)-a(35) from Michael S. Branicky, Sep 30 2022
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 August 10 00:01 EDT 2024. Contains 375044 sequences. (Running on oeis4.)