OFFSET
0,3
COMMENTS
Every term is even.
For a guide to related sequences, see A211795.
LINKS
Index entries for linear recurrences with constant coefficients, signature (1, 3, -3, -3, 3, 1, -1).
FORMULA
a(n)=a(n-1)+3*a(n-2)-3*a(n-3)-3*a(n-4)+3*a(n-5)+a(n-6)-a(n-7).
G.f.: 2*x^2*(1+3*x+6*x^2+x^4+3*x^3) / ( (1+x)^3*(x-1)^4 )
a(n) = n*(n-1)*(14*n-7+3*(-1)^n)/24. - R. J. Mathar, Jul 01 2013
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[w + Abs[x - y] == Abs[x - z] + Abs[y - z],
s = s + 1],
{w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
Map[t[#] &, Range[0, 40]] (* A212691 *)
%/2 (* integers *)
LinearRecurrence[{1, 3, -3, -3, 3, 1, -1}, {0, 0, 2, 8, 26, 50, 100}, 40]
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 25 2012
STATUS
approved