OFFSET
0,2
COMMENTS
The gapsizes are |w-x|, |x-y|, |y-z|. Every term is even. For a guide to related sequences, see A211795.
LINKS
Vincenzo Librandi, Table of n, a(n) for n = 0..1000
Index entries for linear recurrences with constant coefficients, signature (4,-6,4,-1).
FORMULA
a(n) = 2*(n-1)*(3*n^2-3*n+5) with n>1, a(0)=0, a(1)=2.
a(n) = 4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4) for n>=6.
G.f.: f(x)/g(x), where f(x)=2*(x+7*x^2+8*x^3+x^4+x^5) and g(x)=(1-x)^4.
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[Min[Abs[w - x], Abs[x - y], Abs[y - z]] == 1, s = s + 1],
{w, 0, n}, {x, 0, n}, {y, 0, n}, {z, 0, n}]; s)]];
m = Map[t[#] &, Range[0, 40]] (* A212894 *)
m/2 (* integers *)
CoefficientList[Series[2*(x+7*x^2+8*x^3+x^4+x^5) /(1-x)^4, {x, 0, 50}], x] (* Vincenzo Librandi, Jul 04 2012 *)
PROG
(Magma) I:=[0, 2, 22, 92, 246, 520]; [n le 6 select I[n] else 4*Self(n-1)-6*Self(n-2)+4*Self(n-3)-Self(n-4): n in [1..40]]; // Vincenzo Librandi, Jul 04 2012
CROSSREFS
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 30 2012
STATUS
approved