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”).

A377572
Total number of elements (with multiplicity) in all subsets of [n] having a square element sum.
2
0, 1, 1, 3, 7, 12, 30, 61, 124, 247, 491, 980, 1962, 3949, 7916, 15863, 31815, 63692, 127570, 255529, 511627, 1024421, 2051038, 4105848, 8218842, 16450989, 32926094, 65897438, 131879440, 263915641, 528125412, 1056802576, 2114639286, 4231226460, 8466125334, 16939180972
OFFSET
0,4
LINKS
FORMULA
a(n) = Sum_{k=0..n} k * A281871(n,k).
EXAMPLE
a(4) = 7: {1}, {4}, {1,3}, {2,3,4}.
a(5) = 12: {1}, {4}, {1,3}, {4,5}, {1,3,5}, {2,3,4}.
MAPLE
b:= proc(n, s) option remember; `if`(n=0, `if`(issqr(s),
[1, 0], 0), b(n-1, s)+(p-> p+[0, p[1]])(b(n-1, s+n)))
end:
a:= n-> b(n, 0)[2]:
seq(a(n), n=0..35);
CROSSREFS
Sequence in context: A063072 A007626 A193297 * A240738 A047068 A167490
KEYWORD
nonn
AUTHOR
Alois P. Heinz, Nov 01 2024
STATUS
approved