login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A357355
Number of nonempty subsets of {1..n} whose elements have an odd average.
5
1, 1, 2, 4, 9, 13, 20, 38, 71, 119, 206, 384, 713, 1285, 2356, 4428, 8331, 15569, 29270, 55582, 105717, 200847, 382808, 732744, 1404667, 2694391, 5178186, 9973416, 19233457, 37125547, 71754692, 138871244, 269038123, 521666967, 1012485750, 1966957674, 3824314685
OFFSET
1,3
FORMULA
a(n) = A051293(n) - A357356(n). - Michael S. Branicky, Sep 25 2022
EXAMPLE
a(6) = 13 subsets: {1}, {3}, {5}, {1, 5}, {2, 4}, {4, 6}, {1, 2, 6}, {1, 3, 5}, {2, 3, 4}, {4, 5, 6}, {1, 2, 3, 6}, {1, 2, 4, 5} and {1, 2, 3, 4, 5}.
PROG
(Python)
from functools import lru_cache
def cond(s, c): q, r = divmod(s, c); return r == 0 and q&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+n, c+1)
a = lambda n: b(n, 0, 0)
print([a(n) for n in range(1, 51)]) # Michael S. Branicky, Sep 25 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Sep 25 2022
EXTENSIONS
a(24)-a(37) from Michael S. Branicky, Sep 25 2022
STATUS
approved