OFFSET
0,2
FORMULA
a(n) = 1 + Sum_{k=1..n} A339612(k).
EXAMPLE
a(8) = 17 subsets: {}, {1}, {2}, {3}, {4}, {5}, {6}, {7}, {8}, {3, 4}, {6, 8}, {1, 4, 8}, {2, 3, 6}, {2, 4, 5, 6}, {1, 2, 4, 6, 8}, {1, 3, 4, 5, 7} and {2, 4, 6, 7, 8}.
PROG
(Python)
from sympy.ntheory.primetest import is_square
from functools import lru_cache
@lru_cache(maxsize=None)
def b(n, sos, c):
if n == 0:
if is_square(sos): return 1
return 0
return b(n-1, sos, c) + b(n-1, sos+n*n, c+1)
a = lambda n: b(n, 0, 0)
print([a(n) for n in range(40)]) # Michael S. Branicky, Dec 10 2020
CROSSREFS
KEYWORD
nonn
AUTHOR
Ilya Gutkovskiy, Dec 09 2020
EXTENSIONS
a(24)-a(38) from Michael S. Branicky, Dec 09 2020
STATUS
approved