OFFSET
0,2
COMMENTS
For a guide to related sequences, see A211795.
LINKS
Colin Barker, Table of n, a(n) for n = 0..1000
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.: (1+x+x^2)*(x^4+6*x^3+16*x^2+6*x+1) / ((1+x)^3*(x-1)^4).
From Colin Barker, Jan 28 2016: (Start)
a(n) = (30*n^3+3*((-1)^n+15)*n^2+3*((-1)^n+15)*n+(-1)^n+15)/16.
a(n) = (15*n^3+24*n^2+24*n+8)/8 for n even.
a(n) = (15*n^3+21*n^2+21*n+7)/8 for n odd.
(End)
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[w == Max[w, x, y, z] - Min[w, x, y, z],
s = s + 1],
{w, 0, n}, {x, 0, n}, {y, 0, n}, {z, 0, n}]; s)]];
Map[t[#] &, Range[0, 40]] (* A212744 *)
PROG
(PARI) Vec((1+x+x^2)*(x^4+6*x^3+16*x^2+6*x+1)/((1+x)^3*(x-1)^4) + O(x^100)) \\ Colin Barker, Jan 28 2016
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 26 2012
STATUS
approved