|
|
A212686
|
|
Number of (w,x,y,z) with all terms in {1,...,n} and 2|w-x|=n+|y-z|.
|
|
2
|
|
|
0, 0, 4, 8, 24, 40, 76, 112, 176, 240, 340, 440, 584, 728, 924, 1120, 1376, 1632, 1956, 2280, 2680, 3080, 3564, 4048, 4624, 5200, 5876, 6552, 7336, 8120, 9020, 9920, 10944, 11968, 13124, 14280, 15576, 16872, 18316, 19760, 21360, 22960
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,3
|
|
COMMENTS
|
For a guide to related sequences, see A211795.
|
|
LINKS
|
|
|
FORMULA
|
a(n)=2*a(n-1)+a(n-2)-4*a(n-3)+a(n-4)+2*a(n-5)-a(n-6).
G.f.: (4*x^2 + 4*x^4)/(1 - 2*x - x^2 + 4*x^3 - x^4 - 2*x^5 + x^6).
|
|
MATHEMATICA
|
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[2 Abs[w - x] == n + Abs[y - z], s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212686 *)
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {0, 0, 4, 8, 24, 40}, 40]
|
|
CROSSREFS
|
|
|
KEYWORD
|
nonn,easy
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|