A211538 Number of ordered triples (w,x,y) with all terms in {1,...,n} and 2w=2n-2x-y.
0, 0, 0, 1, 3, 5, 9, 12, 18, 22, 30, 35, 45, 51, 63, 70, 84, 92, 108, 117, 135, 145, 165, 176, 198, 210, 234, 247, 273, 287, 315, 330, 360, 376, 408, 425, 459, 477, 513, 532, 570, 590, 630, 651, 693, 715, 759, 782, 828, 852, 900, 925, 975, 1001, 1053, 1080, 1134, 1162
Offset: 1
Links
- Reinhard Zumkeller, Table of n, a(n) for n = 1..10000
- Bruno Berselli, Illustration of the initial positive terms
- Index entries for linear recurrences with constant coefficients, signature (1,2,-2,-1,1).
Crossrefs
Cf. A211422.
Programs
-
Haskell
a211538 n = a211538_list !! (n-1) a211538_list = scanl (+) 0 a029578_list -- Reinhard Zumkeller, Nov 27 2012
-
Magma
[(6*n^2-26*n+25-(2*n-7)*(-1)^n)/16: n in [1..60]]; // Bruno Berselli, Jun 03 2014
-
Maple
A211538:=n->(6*n^2-26*n+25-(2*n-7)*(-1)^n)/16: seq(A211538(n), n=1..100); # Wesley Ivan Hurt, May 18 2015
-
Mathematica
t[n_] := t[n] = Flatten[Table[2 w + 2 x + y - 2 n, {w, n}, {x, n}, {y, n}]]; c[n_] := Count[t[n], 0]; t = Table[c[n], {n, 0, 70}] Table[(6*n^2 - 26*n + 25 - (2*n - 7)*(-1)^n)/16, {n, 100}] (* Wesley Ivan Hurt, May 18 2015 *) LinearRecurrence[{1, 2, -2, -1, 1}, {0, 0, 0, 1, 3}, 70] (* Vincenzo Librandi, May 19 2015 *)
Formula
a(n) = a(n-1) + 2*a(n-2) - 2*a(n-3) - a(n-4) + a(n-5).
a(n) = (6*n^2-26*n+25-(2*n-7)*(-1)^n)/16, from Luce ETIENNE. [Bruno Berselli, Jun 03 2014]
From Wesley Ivan Hurt, May 18 2015: (Start)
G.f.: x^3*(1 + 2 x)/((1 - x)^3*(x + 1)^2).
a(n) = Sum_{i=ceiling((n-3)/2)..n-3} i. (End)
Comments