A212898 Number of (w,x,y,z) with all terms in {0,...,n} and (least gapsize)<=2.
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
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).
Crossrefs
Cf. A211795.
Programs
-
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 *)
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]
Comments