A212576 Number of (w,x,y,z) with all terms in {1,...,n} and |w-x|=2|x-y|+2|y-z|.
0, 1, 2, 7, 16, 33, 52, 87, 126, 181, 246, 331, 422, 545, 674, 831, 1006, 1213, 1428, 1691, 1964, 2277, 2614, 2995, 3388, 3845, 4314, 4835, 5388, 5997, 6620, 7323, 8042, 8825, 9646, 10535, 11442, 12445, 13466, 14563, 15706, 16929, 18172
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (0, 1, 2, 1, -2, -2, -2, 1, 2, 1, 0, -1).
Crossrefs
Cf. A211795.
Programs
-
Mathematica
t = Compile[{{n, _Integer}}, Module[{s = 0}, (Do[If[Abs[w - x] == 2 Abs[x - y] + 2 Abs[y - z], s = s + 1], {w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]]; Map[t[#] &, Range[0, 40]] (* A212576 *) LinearRecurrence[{0, 1, 2, 1, -2, -2, -2, 1, 2, 1, 0, -1}, {0, 1, 2, 7, 16, 33, 52, 87, 126, 181, 246, 331}, 50]
Formula
a(n) = a(n-2)+2*a(n-3)+a(n-4)-2*a(n-5)-2*a(n-6)-2*a(n-7)+a(n-8)+2*a(n-9)+a(n-10)-a(n-12).
G.f.: (x + 2*x^2 + 6*x^3 + 12*x^4 + 21*x^5 + 22*x^6 + 21*x^7 + 12*x^8 + 6*x^9 + 2*x^10 + x^11)/(1 - x^2 - 2*x^3 - x^4 + 2*x^5 + 2*x^6 + 2*x^7 - x^8 - 2*x^9 - x^10 + x^12).
Comments