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
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
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
KEYWORD
nonn,easy
AUTHOR
Necip Fazil Patat, Dec 28 2016
EXTENSIONS
More terms from Colin Barker, Dec 28 2016
STATUS
approved