A213398 Number of (w,x,y) with all terms in {0,...,n} and min(|w-x|,|x-y|) = x.
1, 4, 10, 17, 27, 38, 52, 67, 85, 104, 126, 149, 175, 202, 232, 263, 297, 332, 370, 409, 451, 494, 540, 587, 637, 688, 742, 797, 855, 914, 976, 1039, 1105, 1172, 1242, 1313, 1387, 1462, 1540, 1619, 1701, 1784, 1870, 1957, 2047, 2138, 2232, 2327
Offset: 0
Links
- Iain Fox, Table of n, a(n) for n = 0..10000
- Index entries for linear recurrences with constant coefficients, signature (2,0,-2,1).
Crossrefs
Cf. A212959.
Programs
-
Mathematica
t = Compile[{{n, _Integer}}, Module[{s = 0}, (Do[If[x == Min[Abs[w - x], Abs[x - y]], s = s + 1], {w, 0, n}, {x, 0, n}, {y, 0, n}]; s)]]; Map[t[#] &, Range[0, 60]] (* A213398 *) LinearRecurrence[{2,0,-2,1},{1,4,10,17},50] (* Harvey P. Dale, Aug 05 2019 *)
-
PARI
first(n) = Vec((1 + 2*x + 2*x^2 - x^3)/((1 - x)^3*(1 + x)) + O(x^n)) \\ Iain Fox, Feb 01 2018
Formula
a(n) = 2*a(n-1) - 2*a(n-3) + a(n-4).
G.f.: (1 + 2*x + 2*x^2 - x^3)/((1 - x)^3*(1 + x)).
a(n) = (n+1)^2 + floor(n/2). [Wesley Ivan Hurt, Jul 15 2013]
From Iain Fox, Feb 01 2018: (Start)
E.g.f.: (1 + e^(2*x) * (3 + 14*x + 4*x^2))/(4 * e^x).
a(n) = (4*n^2 + 10*n + (-1)^n + 3)/4.
(End)
Comments