OFFSET
0,3
COMMENTS
For a guide to related sequences, see A211795.
LINKS
Index entries for linear recurrences with constant coefficients, signature (0, 1, 2, 1, -2, -2, -2, 1, 2, 1, 0, -1).
FORMULA
a(n) = a(n-2)+2*a(n-3)+a(n-4)-2*a(n-5)-2*a(n-6)-2*a(n-7)+a(n-8)+2*a(n-9)+a(n-10)-a(n-12).
G.f.: (x + 2*x^2 + 6*x^3 + 12*x^4 + 21*x^5 + 22*x^6 + 21*x^7 + 12*x^8 + 6*x^9 + 2*x^10 + x^11)/(1 - x^2 - 2*x^3 - x^4 + 2*x^5 + 2*x^6 + 2*x^7 - x^8 - 2*x^9 - x^10 + x^12).
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[Abs[w - x] == 2 Abs[x - y] + 2 Abs[y - z],
s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212576 *)
LinearRecurrence[{0, 1, 2, 1, -2, -2, -2, 1, 2, 1, 0, -1}, {0, 1, 2, 7, 16, 33, 52, 87, 126, 181, 246, 331}, 50]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 22 2012
STATUS
approved