OFFSET
0,3
COMMENTS
For a guide to related sequences, see A211795.
Apart from the first term, partial sums of A220082. [Bruno Berselli, Dec 05 2012]
LINKS
Index entries for linear recurrences with constant coefficients, signature (2,1,-4,1,2,-1).
FORMULA
a(n) = 2a(n-1)+a(n-2)-4a(n-3)+a(n-4)+2a(n-5)-a(n-6).
a(n) = n*(-1-3*(-1)^n+10*n^2)/12. G.f.: x*(x^4+4*x^3+10*x^2+4*x+1)/((x-1)^4*(x+1)^2). [Colin Barker, Oct 04 2012]
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[Abs[w - x] == Abs[x - y] + Abs[y - z], s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212570 *)
LinearRecurrence[{2, 1, -4, 1, 2, -1}, {0, 1, 6, 23, 52, 105}, 40] (* Harvey P. Dale, Oct 02 2021 *)
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 22 2012
STATUS
approved