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!)
A357412 Number of nonempty subsets of {1..n} whose elements have an even harmonic mean. 3
0, 1, 1, 2, 2, 7, 7, 8, 8, 9, 9, 16, 16, 17, 27, 28, 28, 55, 55, 106, 110, 111, 111, 216, 216, 217, 217, 634, 634, 1155, 1155, 1156, 2286, 2287, 3749 (list; graph; refs; listen; history; text; internal format)
OFFSET
1,4
LINKS
FORMULA
a(p) = a(p-1) for prime p > 2. - Michael S. Branicky, Sep 30 2022
EXAMPLE
a(11) = 9 subsets: {2}, {4}, {6}, {8}, {10}, {3, 6}, {1, 3, 6}, {3, 4, 6} and {1, 2, 3, 6}.
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 == 0
@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: A261710 A064288 A054085 * A021443 A045923 A306238
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 September 14 06:54 EDT 2024. Contains 375920 sequences. (Running on oeis4.)