A213485 Number of (w,x,y) with all terms in {0,...,n} and |w-x|+|x-y|+|y-w| != w+x+y.
0, 4, 20, 54, 109, 191, 309, 469, 674, 930, 1246, 1628, 2079, 2605, 3215, 3915, 4708, 5600, 6600, 7714, 8945, 10299, 11785, 13409, 15174, 17086, 19154, 21384, 23779, 26345, 29091, 32023, 35144, 38460, 41980, 45710, 49653, 53815, 58205
Offset: 0
Links
- Index entries for linear recurrences with constant coefficients, signature (4,-7,8,-7,4,-1).
Programs
-
Mathematica
t = Compile[{{n, _Integer}}, Module[{s = 0}, (Do[If[w + x + y != Abs[w - x] + Abs[x - y] + Abs[y - w], s = s + 1], {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]]; Map[t[#] &, Range[0, 60]] (* A213485 *)
Formula
a(n) = 4*a(n-1)-7*a(n-2)+8*a(n-3)-7*a(n-4)+4*a(n-5)-a(n-6).
G.f.: (x (4 + 4*x + 2*x^2 + x^3 + x^4))/((1 - x)^4 (1 + x^2)).
Comments