login
A212691
Number of (w,x,y,z) with all terms in {1,...,n} and w+|x-y|<=|x-z|+|y-z|.
2
0, 0, 2, 8, 26, 50, 100, 154, 252, 348, 510, 660, 902, 1118, 1456, 1750, 2200, 2584, 3162, 3648, 4370, 4970, 5852, 6578, 7636, 8500, 9750, 10764, 12222, 13398, 15080, 16430, 18352, 19888, 22066, 23800, 26250, 28194, 30932, 33098, 36140
OFFSET
0,3
COMMENTS
Every term is even.
For a guide to related sequences, see A211795.
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
Cf. A211795.
Sequence in context: A242747 A195585 A102942 * A206803 A212527 A227015
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 25 2012
STATUS
approved