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.

A242499 Number of compositions of n, where the difference between the number of odd parts and the number of even parts is 1.

Original entry on oeis.org

1, 0, 1, 3, 1, 9, 11, 18, 51, 65, 151, 290, 477, 1043, 1835, 3486, 6931, 12540, 24607, 46797, 87979, 171072, 323269, 619245, 1190619, 2264925, 4357211, 8343322, 15973309, 30711853, 58846191, 113027716, 217192103, 416964202, 801880039, 1541412015, 2963997227
Offset: 1

Views

Author

Alois P. Heinz, May 16 2014

Keywords

Comments

With offset 2 number of compositions of n, where the difference between the number of odd parts and the number of even parts is -1.

Crossrefs

Column k=1 of A242498.

Programs

  • Maple
    a:= proc(n) option remember;
          `if`(n<6, [0, 1, 0, 1, 3, 1][n+1],
          ((3*n-2)*a(n-2) +(4*n+2)*a(n-3) -(3*n-10)*a(n-4)
           -(4*n-22)*a(n-5) +(n-6)*a(n-6))/(n+2))
        end:
    seq(a(n), n=1..50);
  • Mathematica
    a[n_] := a[n] = If[n<6, {0, 1, 0, 1, 3, 1}[[n+1]], ((3n-2)a[n-2] + (4n+2)a[n-3] - (3n-10)a[n-4] - (4n-22)a[n-5] + (n-6)a[n-6])/(n+2)];
    Array[a, 50] (* Jean-François Alcover, Dec 28 2020, after Alois P. Heinz *)

Formula

Recurrence (for n>=5): (n+2)*(16*n^4 - 128*n^3 + 344*n^2 - 352*n + 89)*a(n) = -32*(n+1)*(2*n-5)*a(n-1) + 2*(16*n^5 - 112*n^4 + 264*n^3 - 320*n^2 + 301*n - 89)*a(n-2) + 2*(2*n-5)*(16*n^4 - 80*n^3 + 80*n^2 + 36*n - 53)*a(n-3) - (n-4)*(16*n^4 - 64*n^3 + 56*n^2 + 16*n - 31)*a(n-4). - Vaclav Kotesovec, May 20 2014