[go: up one dir, main page]

login
A212576
Number of (w,x,y,z) with all terms in {1,...,n} and |w-x|=2|x-y|+2|y-z|.
2
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,3
COMMENTS
For a guide to related sequences, see A211795.
LINKS
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).
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]
CROSSREFS
Cf. A211795.
Sequence in context: A332232 A333395 A130869 * A208995 A023612 A192952
KEYWORD
nonn,easy
AUTHOR
Clark Kimberling, May 22 2012
STATUS
approved