OFFSET
1,3
COMMENTS
The geometric mean of a subset such as in name must be an odd number in {1..n} which might ease the search for terms. - David A. Corneth, Sep 29 2022
FORMULA
a(2*n-1) = a(2*n) for n >= 1. - David A. Corneth, Sep 29 2022
EXAMPLE
a(9) = 7 subsets: {1}, {3}, {5}, {7}, {9}, {1, 9} and {1, 3, 9}.
PROG
(Python)
from functools import lru_cache
from sympy import integer_nthroot
def cond(p, c): r, b = integer_nthroot(p, c); return b and r&1
@lru_cache(maxsize=None)
def b(n, p, c):
if n == 0: return int (c > 0 and cond(p, c))
return b(n-1, p, c) + b(n-1, p*n, c+1) if n&1 else b(n-1, p, c)
@lru_cache(maxsize=None)
def a(n): return b(n, 1, 0) if n&1 else b(n-1, 1, 0)
print([a(n) for n in range(1, 41)]) # Michael S. Branicky, Sep 29 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Sep 27 2022
EXTENSIONS
a(24)-a(34) from Michael S. Branicky, Sep 29 2022
More terms from David A. Corneth, Sep 29 2022
STATUS
approved