login
A280186
Number of 3-element subsets of S = {1..n} whose sum is odd.
1
0, 0, 0, 0, 2, 4, 10, 16, 28, 40, 60, 80, 110, 140, 182, 224, 280, 336, 408, 480, 570, 660, 770, 880, 1012, 1144, 1300, 1456, 1638, 1820, 2030, 2240, 2480, 2720, 2992, 3264, 3570, 3876, 4218, 4560, 4940, 5320, 5740, 6160, 6622, 7084, 7590, 8096, 8648, 9200
OFFSET
0,5
COMMENTS
The same as A006584 (apart from the offset). - R. J. Mathar, Jan 15 2017
There are two cases: n is odd and n is even.
Let n be an odd integer and n > 3, the sum of 3 integers is odd when all of them are odd or one is odd and the others are even. Number of ways to choose 3 odd numbers: C((n+1)/2, 3). Number of ways to choose 2 even numbers and 1 odd: C((n-1)/2, 2)*C((n+1)/2, 1). Total number of ways: C((n+1)/2, 3) + C((n-1)/2, 2)*C((n+1)/2,1).
Let n be an even integer and n > 3. Number of ways to choose 3 odd numbers: C(n/2, 3). Number of ways to choose 2 even numbers and 1 odd: C(n/2, 2)*C(n/2, 1). Total number of ways: C(n/2, 3) + C(n/2, 2)*C(n/2, 1).
Take a chessboard of n X n unit squares in which the a1 square is black. a(n) is the number of composite squares having white unit squares on their vertices. For the number of composite squares having black unit squares on their vertices see A005993. - Ivan N. Ianakiev, Aug 19 2018
FORMULA
a(n) = C((n+1)/2, 3) + C((n-1)/2, 2)*C((n+1)/2,1) when n is odd.
a(n) = C(n/2, 3) + C(n/2, 2)*C(n/2, 1) when n is even.
From Colin Barker, Dec 28 2016: (Start)
a(n) = 2*a(n-1) + a(n-2) - 4*a(n-3) + a(n-4) + 2*a(n-5) - a(n-6) for n>5.
a(n) = n*(n - 1)*(n - 2)/12 for n even.
a(n) = (n - 1)*(n + 1)*(n - 3)/12 for n odd.
G.f.: 2*x^4 / ((1-x)^4*(1+x)^2). (End)
a(n) = ((-1)^n)*(-1+n)*(3 - 3*(-1)^n - 4*((-1)^n)*n + 2*((-1)^n)*n^2)/24. - Ivan N. Ianakiev, Aug 19 2018
EXAMPLE
For n = 5 then a(5) = 4. The subsets are: {1, 2, 4}, {1, 3, 5}, {2, 3, 4}, {2, 4, 5}.
MATHEMATICA
Table[Binomial[(n + #)/2, 3] + Binomial[(n - #)/2, 2] Binomial[(n + #)/2, 1] &@ Boole@ OddQ@ n, {n, 0, 49}] (* or *)
CoefficientList[Series[2 x^4/((1 - x)^4*(1 + x)^2), {x, 0, 49}], x] (* Michael De Vlieger, Jan 07 2017 *)
PROG
(PARI) concat(vector(4), Vec(2*x^4 / ((1-x)^4*(1+x)^2) + O(x^60))) \\ Colin Barker, Dec 28 2016
CROSSREFS
Essentially 2*A006918.
Same as A006584.
Sequence in context: A293154 A144834 A006584 * A032246 A219901 A141138
KEYWORD
nonn,easy
AUTHOR
Necip Fazil Patat, Dec 28 2016
EXTENSIONS
More terms from Colin Barker, Dec 28 2016
STATUS
approved