|
|
A047653
|
|
Constant term in expansion of (1/2) * Product_{k=-n..n} (1 + x^k).
|
|
23
|
|
|
1, 2, 4, 10, 26, 76, 236, 760, 2522, 8556, 29504, 103130, 364548, 1300820, 4679472, 16952162, 61790442, 226451036, 833918840, 3084255128, 11451630044, 42669225172, 159497648600, 597950875256, 2247724108772, 8470205600640, 31991616634296, 121086752349064
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,2
|
|
COMMENTS
|
Or, constant term in expansion of Product_{k=1..n} (x^k + 1/x^k)^2. - N. J. A. Sloane, Jul 09 2008
Or, maximal coefficient of the polynomial (1+x)^2 * (1+x^2)^2 *...* (1+x^n)^2.
Also the number of subsets of {1..2n} that are empty or have mean n. The a(0) = 1 through a(3) = 10 subsets are:
{} {} {} {}
{1} {2} {3}
{1,3} {1,5}
{1,2,3} {2,4}
{1,2,6}
{1,3,5}
{2,3,4}
{1,2,3,6}
{1,2,4,5}
{1,2,3,4,5}
Also the number of subsets of {-n..n} with no 0's but with sum 0. The a(0) = 1 through a(3) = 10 subsets are:
{} {} {} {}
{-1,1} {-1,1} {-1,1}
{-2,2} {-2,2}
{-2,-1,1,2} {-3,3}
{-3,1,2}
{-2,-1,3}
{-2,-1,1,2}
{-3,-1,1,3}
{-3,-2,2,3}
{-3,-2,-1,1,2,3}
(End)
|
|
LINKS
|
T. D. Noe, Alois P. Heinz and Ray Chandler, Table of n, a(n) for n = 0..1669 (terms < 10^1000, first 201 terms from T. D. Noe, next 200 terms from Alois P. Heinz)
|
|
FORMULA
|
Sum of squares of coefficients in Product_{k=1..n} (1+x^k):
(End)
|
|
MAPLE
|
f:=n->coeff( expand( mul((x^k+1/x^k)^2, k=1..n) ), x, 0);
# second Maple program:
b:= proc(n, i) option remember; `if`(n>i*(i+1)/2, 0,
`if`(i=0, 1, 2*b(n, i-1)+b(n+i, i-1)+b(abs(n-i), i-1)))
end:
a:=n-> b(0, n):
|
|
MATHEMATICA
|
b[n_, i_] := b[n, i] = If[n>i*(i+1)/2, 0, If[i == 0, 1, 2*b[n, i-1]+b[n+i, i-1]+b[Abs[n-i], i-1]]]; a[n_] := b[0, n]; Table[a[n], {n, 0, 40}] (* Jean-François Alcover, Mar 10 2014, after Alois P. Heinz *)
nmax = 26; d = {1}; a1 = {};
Do[
i = Ceiling[Length[d]/2];
AppendTo[a1, If[i > Length[d], 0, d[[i]]]];
d = PadLeft[d, Length[d] + 2 n] + PadRight[d, Length[d] + 2 n] +
2 PadLeft[PadRight[d, Length[d] + n], Length[d] + 2 n];
, {n, nmax}];
Table[Length[Select[Subsets[Range[2n]], Length[#]==0||Mean[#]==n&]], {n, 0, 6}] (* Gus Wiseman, Apr 18 2023 *)
|
|
PROG
|
(PARI) a(n)=polcoeff(prod(k=-n, n, 1+x^k), 0)/2
(PARI) {a(n)=sum(k=0, n*(n+1)/2, polcoeff(prod(m=1, n, 1+x^m+x*O(x^k)), k)^2)} \\ Paul D. Hanna, Nov 30 2010
|
|
CROSSREFS
|
For median instead of mean we have A079309(n) + 1.
A000980 counts nonempty subsets of {1..2n-1} with mean n.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
EXTENSIONS
|
|
|
STATUS
|
approved
|
|
|
|