OFFSET
1,4
FORMULA
a(p) = a(p-1) for prime p > 2. - Michael S. Branicky, Sep 30 2022
EXAMPLE
a(8) = 8 subsets: {2}, {4}, {6}, {8}, {1, 4}, {2, 8}, {1, 2, 4} and {2, 4, 8}.
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 == 0
@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)
a = lambda n: b(n, 1, 0)
print([a(n) for n in range(1, 26)]) # Michael S. Branicky, Sep 29 2022
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Sep 27 2022
EXTENSIONS
a(24)-a(41) from Michael S. Branicky, Sep 30 2022
Terms a(42) onward from Max Alekseyev, Oct 11 2023
STATUS
approved