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.

A106357 Number of compositions of n with exactly 1 adjacent equal pair of parts.

Original entry on oeis.org

1, 0, 3, 6, 7, 20, 42, 72, 141, 280, 516, 976, 1853, 3420, 6361, 11844, 21819, 40192, 73942, 135452, 247828, 452776, 825252, 1501998, 2730159, 4954890, 8981360, 16261568, 29408708, 53130154, 95894384, 172917788, 311538169, 560831286
Offset: 2

Views

Author

Christian G. Bower, Apr 29 2005

Keywords

Crossrefs

Column 1 of A106356. Cf. A003242.
Cf. A241902.

Programs

  • Maple
    b:= proc(n, v) option remember; `if`(n=0, [1, 0],
          add((p-> `if`(i=v, [0, p[1]], p))(b(n-i, i)), i=1..n))
        end:
    a:= n-> b(n, 0)[2]:
    seq(a(n), n=2..45);  # Alois P. Heinz, May 09 2014
  • Mathematica
    b[n_, v_] := b[n, v] = If[n == 0, {1, 0}, Sum[Function[p, If[i == v, {0, p[[1]]}, p]][b[n - i, i]], {i, 1, n}]];
    a[n_] := b[n, 0][[2]];
    a /@ Range[2, 45] (* Jean-François Alcover, Nov 02 2020, after Alois P. Heinz *)
  • PARI
    C_x(N)={my(g=1/(1 - sum(k=1, N, x^k/(1+x^k))));g}
    A_x(N)={my(x='x+O('x^N), h=sum(i=1,N,(C_x(N)*x^(2*i))/(1+x^i)^2 )/(1-sum(i=1,N,(x^i)/(1+x^i)))); Vec(h)}
    A_x(40) \\ John Tyler Rascoe, May 16 2024

Formula

a(n) ~ c * d^n * n, where d = A241902 = 1.750241291718309031249738624639..., c = 0.04826600476992825168367... . - Vaclav Kotesovec, Sep 05 2014
G.f.: (Sum_{i>0} C(x)*x^(2*i)/(1+x^i)^2)/(1 - Sum_{i>0} x^i/(1+x^i)) where C(x) is the g.f. for A003242. - John Tyler Rascoe, May 16 2024

Extensions

Replaced broken link, Vaclav Kotesovec, May 01 2014