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.

A106358 Number of compositions of n with exactly 2 adjacent equal parts (2 pairs or 1 triple.).

Original entry on oeis.org

1, 0, 2, 8, 10, 22, 58, 112, 219, 466, 920, 1787, 3600, 7025, 13532, 26315, 50625, 96775, 185000, 351714, 665942, 1258649, 2371219, 4454004, 8348735, 15612146, 29128863, 54245790, 100828939, 187074952, 346527510, 640878692, 1183480187
Offset: 3

Views

Author

Christian G. Bower, Apr 29 2005

Keywords

Crossrefs

Column 2 of A106356. Cf. A003242.
Cf. A241902.

Programs

  • Maple
    b:= proc(n, v) option remember; `if`(n=0, [1, 0$2], add((
          p->`if`(i=v, [0, p[1..2][]], p))(b(n-i, i)), i=1..n))
        end:
    a:= n-> b(n, 0)[3]:
    seq(a(n), n=3..45);  # Alois P. Heinz, Jun 24 2014
  • Mathematica
    b[n_, v_] := b[n, v] = If[n==0, {1, 0, 0}, Sum[If[i==v, Prepend[#[[1;;2]], 0], #]&[b[n-i, i]], {i, 1, n}]];
    a[n_] := b[n, 0][[3]];
    a /@ Range[3, 45] (* Jean-François Alcover, Nov 18 2020, after Alois P. Heinz *)

Formula

a(n) ~ c * d^n * n^2, where d = 1.7502412917183090312497386246... (see A241902), c = 0.0025523594118210599072896951... . - Vaclav Kotesovec, Aug 25 2014