login
A212898
Number of (w,x,y,z) with all terms in {0,...,n} and (least gapsize)<=2.
3
1, 16, 81, 254, 609, 1234, 2215, 3640, 5599, 8182, 11479, 15580, 20575, 26554, 33607, 41824, 51295, 62110, 74359, 88132, 103519, 120610, 139495, 160264, 183007, 207814, 234775, 263980, 295519, 329482, 365959, 405040, 446815, 491374
OFFSET
0,2
COMMENTS
The gapsizes are |w-x|, |x-y|, |y-z|.
a(n)+A212899(n) = (n+1)^4.
For a guide to related sequences, see A211795.
FORMULA
a(n) = 4*a(n-1)-6*a(n-2)+4*a(n-3)-a(n-4) for n>=9.
G.f.: (1 + 12*x + 23*x^2 + 22*x^3 + 16*x^4 + 14*x^5 - 2*x^6 + 2*x^7 + 2*x^8)/(1 - x)^4.
a(n) = 15*n^3-48*n^2+144*n-161 with n>4, a(0)=1, a(1)=16, a(2)=81, a(3)=254, a(4)=609. [Bruno Berselli, Jun 12 2012]
MATHEMATICA
t = Compile[{{n, _Integer}}, Module[{s = 0},
(Do[If[Min[Abs[w - x], Abs[x - y], Abs[y - z]] <= 2, s = s + 1],
{w, 0, n}, {x, 0, n}, {y, 0, n}, {z, 0, n}]; s)]];
m = Map[t[#] &, Range[0, 40]] (* A212898 *)
CoefficientList[Series[(1+12*x+23*x^2+22*x^3+16*x^4+14*x^5-2*x^6+ 2*x^7+ 2*x^8)/(1-x)^4, {x, 0, 40}], x] (* Vincenzo Librandi, Jul 04 2012 *)
CROSSREFS
Cf. A211795.
Sequence in context: A224135 A265154 A268198 * A212145 A250362 A217261
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 31 2012
STATUS
approved