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.

Showing 1-5 of 5 results.

A114320 Triangle T(n,k) = number of permutations of n elements with k 2-cycles.

Original entry on oeis.org

1, 1, 1, 1, 3, 3, 15, 6, 3, 75, 30, 15, 435, 225, 45, 15, 3045, 1575, 315, 105, 24465, 12180, 3150, 420, 105, 220185, 109620, 28350, 3780, 945, 2200905, 1100925, 274050, 47250, 4725, 945, 24209955, 12110175, 3014550, 519750, 51975, 10395, 290529855
Offset: 0

Views

Author

Vladeta Jovovic, Feb 05 2006

Keywords

Comments

Row n has 1+floor(n/2) terms. Row sums yield the factorials (A000142). Sum(k*T(n,k),k>0)=n!/2 for n>=2. - Emeric Deutsch, Feb 17 2006

Examples

			T(3,1) = 3 because we have (1)(23), (12)(3) and (13)(2).
Triangle begins:
    1;
    1;
    1,   1;
    3,   3;
   15,   6,   3;
   75,  30,  15;
  435, 225,  45,  15;
  ...
		

Crossrefs

Programs

  • Maple
    G:= exp((y-1)*x^2/2)/(1-x): Gser:= simplify(series(G,x=0,15)): P[0]:=1: for n from 1 to 12 do P[n]:= n!*coeff(Gser,x^n) od: for n from 0 to 12 do seq(coeff(y*P[n], y^j), j=1..1+floor(n/2)) od;  # yields sequence in triangular form - Emeric Deutsch, Feb 17 2006
  • Mathematica
    d = Exp[-x^2/2!]/(1 - x);f[list_] := Select[list, # > 0 &]; Flatten[Map[f, Transpose[Table[Range[0, 10]!CoefficientList[Series[x^(2 k)/(2^k k!) d, {x, 0, 10}], x], {k, 0, 5}]]]]  (* Geoffrey Critzer, Nov 29 2011 *)

Formula

E.g.f.: exp((y-1)*x^2/2)/(1-x). More generally, e.g.f. for number of permutations of n elements with k m-cycles is exp((y-1)*x^m/m)/(1-x).
T(n,k) = n!/(2^k*k!) * Sum_{j=0..floor(n/2)-k} (-1/2)^j/j!. - Alois P. Heinz, Nov 30 2011

Extensions

More terms from Emeric Deutsch, Feb 17 2006

A218796 Triangular array read by rows: T(n,k) is the number of compositions of n that have exactly k 3's; n>=0, 0<=k<=floor(n/3).

Original entry on oeis.org

1, 1, 2, 3, 1, 6, 2, 11, 5, 21, 10, 1, 39, 22, 3, 73, 46, 9, 136, 97, 22, 1, 254, 200, 54, 4, 474, 410, 126, 14, 885, 832, 290, 40, 1, 1652, 1679, 651, 109, 5, 3084, 3368, 1440, 280, 20, 5757, 6725, 3138, 698, 65, 1, 10747, 13370, 6762, 1688, 195, 6, 20062, 26483, 14424, 3994, 546, 27
Offset: 0

Views

Author

Geoffrey Critzer, Nov 05 2012

Keywords

Comments

Row Sums = 2^(n-1) for n>0.

Examples

			1;
1;
2;
3,       1;
6,       2;
11,      5;
21,     10,    1;
39,     22,    3;
73,     46,    9;
136,    97,   22,   1;
254,   200,   54,   4;
474,   410,  126,  14;
885,   832,  290,  40,   1;
1652, 1679,  651, 109,   5;
3084, 3368, 1440, 280,  20;
5757, 6725, 3138, 698,  65,  1;
		

Crossrefs

Column k=0 gives: A049856(n+2).

Programs

  • Maple
    T:= proc(n) option remember; local j; if n=0 then 1
          else []; for j to n do zip((x, y)-> x+y, %,
          [`if`(j=3, 0, [][]), T(n-j)], 0) od; %[] fi
        end:
    seq (T(n), n=0..25);  # Alois P. Heinz, Nov 05 2012
  • Mathematica
    nn=15;f[list_]:=Select[list,#>0&];Map[f,CoefficientList[Series[1/(1-(x/(1-x)-x^3+y x^3)),{x,0,nn}],{x,y}]]//Grid

Formula

O.g.f.: 1/(1-(x/(1-x)-x^3+y*x^3)) and generally for the number of compositions with k parts of size r we have: 1/(1-(x/(1-x)-x^r+y*x^r)).

A120924 Triangle read by rows: T(n,k) is the number of ternary words of length n on {0,1,2}, having k isolated 0's (n >= 0, k >= 0).

Original entry on oeis.org

1, 2, 1, 5, 4, 13, 12, 2, 33, 36, 12, 83, 108, 48, 4, 209, 316, 172, 32, 527, 904, 588, 160, 8, 1329, 2548, 1932, 672, 80, 3351, 7104, 6140, 2592, 480, 16, 8449, 19628, 19020, 9440, 2320, 192, 21303, 53816, 57756, 32896, 10000, 1344, 32, 53713, 146596
Offset: 0

Views

Author

Emeric Deutsch, Jul 16 2006

Keywords

Comments

Row n has 1+ceiling(n/2) terms.
Row sums are the powers of 3 (A000244).
T(n,0) = A120925(n).
Sum_{k=0..ceiling(n/2)} k*T(n,k) = A120926(n).

Examples

			T(2,0)=5 because we have 00,11,12,21 and 22; T(2,1)=4 because we have 01,02,10 and 20; T(3,2)=2 because we have 010 and 020.
Triangle starts:
   1;
   2,   1;
   5,   4;
  13,  12,  2;
  33,  36, 12;
  83, 108, 48, 4;
		

Crossrefs

Programs

  • Maple
    G:=(1-(1-t)*z*(1-z))/(1-3*z+2*(1-t)*z^2*(1-z)): Gser:=simplify(series(G,z=0,15)): P[0]:=1: for n from 1 to 13 do P[n]:=sort(coeff(Gser,z^n)) od: for n from 0 to 13 do seq(coeff(P[n],t,j),j=0..ceil(n/2)) od; # yields sequence in triangular form

Formula

G.f. = G(t,z) = (1-(1-t)z(1-z))/(1 - 3z + 2(1-t)z^2*(1-z)).

A120925 Number of ternary words on {0,1,2} having no isolated 0's.

Original entry on oeis.org

1, 2, 5, 13, 33, 83, 209, 527, 1329, 3351, 8449, 21303, 53713, 135431, 341473, 860983, 2170865, 5473575, 13800961, 34797463, 87737617, 221219847, 557779233, 1406373239, 3546000945, 8940814823, 22543189057, 56839939415, 143315069777
Offset: 0

Views

Author

Emeric Deutsch, Jul 16 2006

Keywords

Comments

Column 0 of A120924.

Examples

			a(2)=5 because we have 00,11,12,21 and 22.
		

Crossrefs

Programs

  • Maple
    a[0]:=1:a[1]:=2:a[2]:=5: for n from 3 to 32 do a[n]:=3*a[n-1]-2*a[n-2]+2*a[n-3] od: seq(a[n],n=0..32);
  • Mathematica
    nn=20;a=x^2/(1-x);CoefficientList[Series[(a+1)/(1-(2x a)/(1-2x))/(1-2x),{x,0,nn}],x]  (* Geoffrey Critzer, Jan 13 2013 *)
    LinearRecurrence[{3,-2,2},{1,2,5},30] (* Harvey P. Dale, Nov 16 2024 *)

Formula

a(n) = 3a(n-1)-2a(n-2)+2a(n-3); a(0)=1, a(1)=2,a(2)=5.
G.f.: (1-z+z^2)/(1-3z+2z^2-2z^3).

A296559 Triangle read by rows: T(n,k) is the number of compositions of n having k parts equal to 1 or 2 (0<=k<=n).

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 1, 0, 2, 1, 1, 2, 1, 3, 1, 1, 4, 3, 3, 4, 1, 2, 4, 9, 5, 6, 5, 1, 3, 7, 12, 16, 9, 10, 6, 1, 4, 13, 18, 28, 26, 16, 15, 7, 1, 6, 19, 36, 42, 55, 41, 27, 21, 8, 1, 9, 29, 60, 82, 90, 97, 64, 43, 28, 9, 1, 13, 47, 94, 152, 170, 177, 160, 99, 65, 36, 10, 1, 19, 73, 158, 252, 335, 333, 323, 253, 151, 94, 45, 11, 1
Offset: 0

Views

Author

Emeric Deutsch, Dec 15 2017

Keywords

Comments

Sum of entries in row n = 2^{n-1} = A011782(n) (n>=1).
Sum(kT(n,k), k>=0) = (3n+5)*2^{n-4} = A106472(n-1) (n>=3).

Examples

			T(3,2) = 2 because we have [1,2],[2,1].
T(6,3) = 5 because we have [2,2,2],[1,1,1,3],[1,1,3,1],[1,3,1,1],[3,1,1,1].
Triangle begins:
  1,
  0, 1,
  0, 1, 1,
  1, 0, 2, 1,
  1, 2, 1, 3, 1,
  1, 4, 3, 3, 4, 1,
  2, 4, 9, 5, 6, 5, 1,
  3, 7, 12, 16, 9, 10, 6, 1,
  4, 13, 18, 28, 26, 16, 15, 7, 1,
  ...
		

Crossrefs

Programs

  • Maple
    g := (1-x)/(1-(1+t)*x-(1-t)*x^3): gser := simplify(series(g, x = 0, 17)): for n from 0 to 15 do p[n] := sort(expand(coeff(gser, x, n))) end do: for n from 0 to 15 do seq(coeff(p[n], t, j), j = 0 .. n) end do; # yields sequence in triangular form
  • Mathematica
    nmax = 12;
    s = Series[(1-x)/(1 - (1+t) x - (1-t) x^3), {x, 0, nmax}, {t, 0, nmax}];
    T[n_, k_] := SeriesCoefficient[s, {x, 0, n}, {t, 0, k}];
    Table[T[n, k], {n, 0, nmax}, {k, 0, n}] // Flatten (* Jean-François Alcover, Dec 16 2017 *)

Formula

G.f.: G(t,x) = (1-x)/(1 - (1 + t)x - (1 - t)x^3).
Showing 1-5 of 5 results.