cp's OEIS Frontend

This is a front-end for the Online Encyclopedia of Integer Sequences, made by Christian Perfect. The idea is to provide OEIS entries in non-ancient HTML, and then to think about how they're presented visually. The source code is on GitHub.

A212684 Number of (w,x,y,z) with all terms in {1,...,n} and |x-y|=n-w+|y-z|.

Original entry on oeis.org

0, 1, 6, 19, 42, 79, 132, 205, 300, 421, 570, 751, 966, 1219, 1512, 1849, 2232, 2665, 3150, 3691, 4290, 4951, 5676, 6469, 7332, 8269, 9282, 10375, 11550, 12811, 14160, 15601, 17136, 18769, 20502, 22339, 24282, 26335, 28500, 30781, 33180
Offset: 0

Views

Author

Clark Kimberling, May 24 2012

Keywords

Comments

For a guide to related sequences, see A211795.
Also the number of (w,x,y) with all terms in {0,...,n-1} and |w-x|>=|x-y|, see A212959. Clark Kimberling, Jun 02 2012

Crossrefs

Cf. A211795.

Programs

  • Mathematica
    t = Compile[{{n, _Integer}}, Module[{s = 0},
    (Do[If[Abs[x - y] == n - w + Abs[y - z], s = s + 1],
    {w, 1, #}, {x, 1, #}, {y, 1, #}, {z, 1, #}] &[n]; s)]];
    Map[t[#] &, Range[0, 40]]   (* A212684 *)
    LinearRecurrence[{3, -2, -2, 3, -1}, {0, 1, 6, 19, 42}, 41] (* Bruno Berselli, Jun 07 2012 *)
  • Maxima
    makelist(coeff(taylor(x*(1+3*x+3*x^2-x^3)/((1+x)*(1-x)^4), x, 0, n), x, n), n, 0, 40); /* Bruno Berselli, May 07 2012 */

Formula

a(n) = 3*a(n-1)-2*a(n-2)-2*a(n-3)+3*a(n-4)-a(n-5).
a(n) + A212683(n) = n^3. Clark Kimberling, Jun 02 2012
G.f.: x*(1+3*x+3*x^2-x^3)/((1+x)*(1-x)^4). [Bruno Berselli, Jun 07 2012]
a(n) = (2*n*(n+2)*(2*n-1)-(-1)^n+1)/8. [Bruno Berselli, Jun 07 2012]