

A159915


a(n) = floor((n+1)/4)*floor(n/2).


1



0, 0, 0, 1, 2, 2, 3, 6, 8, 8, 10, 15, 18, 18, 21, 28, 32, 32, 36, 45, 50, 50, 55, 66, 72, 72, 78, 91, 98, 98, 105, 120, 128, 128, 136, 153, 162, 162, 171, 190, 200, 200, 210, 231, 242, 242, 253, 276, 288, 288, 300, 325, 338, 338, 351, 378, 392, 392, 406, 435, 450, 450
(list;
graph;
refs;
listen;
history;
text;
internal format)



OFFSET

0,5


COMMENTS

Half the number of (n2)element subsets of {1,...,n} with odd sum of the elements.
This is half the antepenultimate column of A159916, cf. formula.
The number of subsets of {1,...,n} with n2 elements, adding up to an odd integer, is always even (cf. examples), so we divide it by 2.
We prefer to include a(0)=a(1)=a(2)=0, even if it might seem more natural to start only at n=2 or n=3.
From the rational g.f. it can be seen that the sequence is a linear recurrence with constant coefficients (3,5,7,7,5,3,1) of order 7.


LINKS

Table of n, a(n) for n=0..61.


FORMULA

G.f.: x^3(1  x + x^2)/(1  3*x + 5*x^2  7*x^3 + 7*x^4  5*x^5 + 3*x^6  x^7).
a(n) = 3*a(n1)  5*a(n2) + 7*a(n3)  7*a(n4) + 5*a(n5)  3*a(n6) + a(n7) for n > 7.
For n > 2, a(n) = A159916(n*(n1)/2 + n  2)/2 = T(n,n2)/2 as defined there.
a(n) = floor((n+1)/4)*floor(n/2); a(2n+1) = A093005(n); a(2n) = A093353(n1) = floor(n/2)*n.  M. F. Hasler, May 03 2009


EXAMPLE

a(0)=a(1)=0 since there are no subsets with 2 or 1 elements.
a(2)=0 since the sum of the elements of a 0element subset is zero.
a(3)=1 since for n=3 we have two singleton subsets of {1,2,3}, {1} and {3}, with odd sum of elements.
a(4)=2 since for n=4 we have four 2element subsets of {1,2,3,4} with odd sum: {1,2}, {2,3}, {1,4}, {3,4}.


PROG

(PARI) A159915(n)=polcoeff((1x+x^2)/(13*x+5*x^27*x^3+7*x^45*x^5+3*x^6x^7)+O(x^(n2)), n3)
a(n, t=[0, 0, 0, 1, 2, 2, 3], c=[1, 3, 5, 7, 7, 5, 3]~)=while(n>5, t=concat(vecextract(t, "^1"), t*c)); t[n+2] /* Note: a(n+1, [0, 0, 0, 0, 1, 2, 2]) gives the same result as a(n) */
(PARI) A159915(n)=(n+1)\4*(n\2) \\\\ M. F. Hasler, May 03 2009


CROSSREFS

Sequence in context: A032062 A303028 A011141 * A007801 A275493 A193595
Adjacent sequences: A159912 A159913 A159914 * A159916 A159917 A159918


KEYWORD

easy,nonn


AUTHOR

M. F. Hasler, May 01 2009, May 03 2009


STATUS

approved



