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.

A244530 Number T(n,k) of ordered unlabeled rooted trees with n nodes such that the minimal outdegree of inner nodes equals k; triangle T(n,k), n>=1, 0<=k<=n-1, read by rows.

Original entry on oeis.org

1, 0, 1, 0, 1, 1, 0, 4, 0, 1, 0, 11, 2, 0, 1, 0, 36, 5, 0, 0, 1, 0, 117, 11, 3, 0, 0, 1, 0, 393, 28, 7, 0, 0, 0, 1, 0, 1339, 78, 8, 4, 0, 0, 0, 1, 0, 4630, 201, 21, 9, 0, 0, 0, 0, 1, 0, 16193, 532, 55, 10, 5, 0, 0, 0, 0, 1, 0, 57201, 1441, 121, 11, 11, 0, 0, 0, 0, 0, 1
Offset: 1

Views

Author

Joerg Arndt and Alois P. Heinz, Jun 29 2014

Keywords

Comments

T(1,0) = 1 by convention.

Examples

			T(5,1) = 11:
  o   o     o     o     o     o     o     o     o     o     o
  |   |     |     |    / \   / \   / \    |    /|\   /|\   /|\
  o   o     o     o   o   o o   o o   o   o   o o o o o o o o o
  |   |    / \   / \  |         | |   |  /|\  |       |       |
  o   o   o   o o   o o         o o   o o o o o       o       o
  |  / \  |         | |         |
  o o   o o         o o         o
  |
  o
Triangle T(n,k) begins:
  1;
  0,     1;
  0,     1,   1;
  0,     4,   0,  1;
  0,    11,   2,  0,  1;
  0,    36,   5,  0,  0, 1;
  0,   117,  11,  3,  0, 0, 1;
  0,   393,  28,  7,  0, 0, 0, 1;
  0,  1339,  78,  8,  4, 0, 0, 0, 1;
  0,  4630, 201, 21,  9, 0, 0, 0, 0, 1;
  0, 16193, 532, 55, 10, 5, 0, 0, 0, 0, 1;
		

Crossrefs

Row sums give A000108(n-1).
Cf. A244454 (unordered unlabeled rooted trees).

Programs

  • Maple
    b:= proc(n, t, k) option remember; `if`(n=0,
          `if`(t in [0, k], 1, 0), `if`(t>n, 0, add(b(j-1, k$2)*
           b(n-j, max(0, t-1), k), j=1..n)))
        end:
    T:= (n, k)-> b(n-1, k$2) -`if`(n=1 and k=0, 0, b(n-1, k+1$2)):
    seq(seq(T(n, k), k=0..n-1), n=1..14);
  • Mathematica
    b[n_, t_, k_] := b[n, t, k] = If[n == 0, If[t == 0 || t == k, 1, 0], If[t>n, 0, Sum[b[j-1, k, k]*b[n-j, Max[0, t-1], k], {j, 1, n}]]]; T[n_, k_] := b[n-1, k, k] - If[n == 1 && k == 0, 0, b[n-1, k+1, k+1]]; Table[Table[T[n, k], {k, 0, n-1}], {n, 1, 14}] // Flatten (* Jean-François Alcover, Jan 13 2015, translated from Maple *)

A059346 Difference array of Catalan numbers A000108 read by antidiagonals.

Original entry on oeis.org

1, 0, 1, 1, 1, 2, 1, 2, 3, 5, 3, 4, 6, 9, 14, 6, 9, 13, 19, 28, 42, 15, 21, 30, 43, 62, 90, 132, 36, 51, 72, 102, 145, 207, 297, 429, 91, 127, 178, 250, 352, 497, 704, 1001, 1430, 232, 323, 450, 628, 878, 1230, 1727, 2431, 3432, 4862, 603, 835, 1158, 1608, 2236, 3114
Offset: 0

Views

Author

N. J. A. Sloane, Jan 27 2001

Keywords

Examples

			Array starts:
      1       1       2       5      14      42     132     429
      0       1       3       9      28      90     297    1001
      1       2       6      19      62     207     704    2431
      1       4      13      43     145     497    1727    6071
      3       9      30     102     352    1230    4344   15483
      6      21      72     250     878    3114   11139   40143
     15      51     178     628    2236    8025   29004  105477
     36     127     450    1608    5789   20979   76473  280221
     91     323    1158    4181   15190   55494  203748  751422
    232     835    3023   11009   40304  148254  547674 2031054
    603    2188    7986   29295  107950  399420 1483380 5527750
Triangle starts:
  1;
  0,  1;
  1,  1,  2;
  1,  2,  3,  5;
  3,  4,  6,  9, 14;
		

Crossrefs

Top row is A000108, leading diagonals give A005043, A001006, A005554.
Row sums are A106640.

Programs

  • Maple
    T := (n,k) -> (-1)^(n-k)*binomial(2*k,k)*hypergeom([k-n,k+1/2], [k+2], 4)/(k+1): seq(seq(simplify(T(n,k)), k=0..n), n=0..10);
    # Peter Luschny, Aug 16 2012, updated May 25 2021
  • Mathematica
    max = 11; t = Table[ Differences[ Table[ CatalanNumber[k], {k, 0, max}], n], {n, 0, max}]; Flatten[ Table[t[[n-k+1, k]], {n, 1, max}, {k, 1, n}]] (* Jean-François Alcover, Nov 15 2011 *)
  • Sage
    def T(n, k) :
        if k > n : return 0
        if n == k : return binomial(2*n, n)/(n+1)
        return T(n-1, k) - T(n, k+1)
    A059346 = lambda n,k: (-1)^(n-k)*T(n, k)
    for n in (0..5): [A059346(n,k) for k in (0..n)] # Peter Luschny, Aug 16 2012

Formula

T(n, k) = (-1)^(n-k)*binomial(2*k,k)/(k+1)*hypergeometric([k-n, k+1/2],[k+2], 4). - Peter Luschny, Aug 16 2012

Extensions

More terms from Larry Reeves (larryr(AT)acm.org), Feb 16 2001

A178517 Triangle read by rows: T(n,k) is the number of non-derangement permutations of {1,2,...,n} having genus k (see first comment for definition of genus).

Original entry on oeis.org

1, 1, 0, 4, 0, 0, 11, 4, 0, 0, 36, 40, 0, 0, 0, 117, 290, 48, 0, 0, 0, 393, 1785, 1008, 0, 0, 0, 0, 1339, 9996, 12712, 1440, 0, 0, 0, 0, 4630, 52584, 123858, 48312, 0, 0, 0, 0, 0, 16193, 264720, 1027446, 904840, 80640, 0, 0, 0, 0, 0, 57201, 1290135, 7627158, 12449800, 3807936, 0
Offset: 1

Views

Author

Emeric Deutsch, May 30 2010

Keywords

Comments

The genus g(p) of a permutation p of {1,2,...,n} is defined by g(p)=(1/2)[n+1-z(p)-z(cp')], where p' is the inverse permutation of p, c = 234...n1 = (1,2,...,n), and z(q) is the number of cycles of the permutation q.
The sum of the entries in row n is A002467(n).
The number of entries in row n is floor(n/2).
T(n,0) = A106640(n-1) .

Examples

			T(3,0)=4 because all non-derangements of {1,2,3}, namely 123=(1)(2)(3), 132=(1)(23), 213=(12)(3), and 321=(13)(2) have genus 0. This follows easily from the fact that a permutation p of {1,2,...,n} has genus 0 if and only if the cycle decomposition of p gives a noncrossing partition of {1,2,...,n} and each cycle of p is increasing (see Lemma 2.1 of the Dulucq-Simion reference).
Triangle starts:
[ 1]  1,
[ 2]  1, 0,
[ 3]  4, 0, 0,
[ 4]  11, 4, 0, 0,
[ 5]  36, 40, 0, 0, 0,
[ 6]  117, 290, 48, 0, 0, 0,
[ 7]  393, 1785, 1008, 0, 0, 0, 0,
[ 8]  1339, 9996, 12712, 1440, 0, 0, 0, 0,
[ 9]  4630, 52584, 123858, 48312, 0, 0, 0, 0, 0,
[10]  16193, 264720, 1027446, 904840, 80640, 0, 0, 0, 0, 0,
[11]  57201, 1290135, 7627158, 12449800, 3807936, 0, 0, 0, 0, 0, 0,
[12]  203799, 6133930, 52188774, 140356480, 96646176, 7257600, 0, ...,
[13]  731602, 28603718, 335517468, 1373691176, 1749377344, 448306560, 0, ...,
...
		

References

  • S. Dulucq and R. Simion, Combinatorial statistics on alternating permutations, J. Algebraic Combinatorics, 8 (1998), 169-191.

Crossrefs

Cf. A177267 (genus of all permutations).
Cf. A178514 (genus of derangements), A178515 (genus of involutions), A178516 (genus of up-down permutations), A178518 (permutations of [n] having genus 0 and p(1)=k), A185209 (genus of connected permutations).

Programs

  • Maple
    n := 7: with(combinat): P := permute(n): inv := proc (p) local j, q: for j to nops(p) do q[p[j]] := j end do: [seq(q[i], i = 1 .. nops(p))] end proc: nrfp := proc (p) local ct, j: ct := 0: for j to nops(p) do if p[j] = j then ct := ct+1 else end if end do: ct end proc: nrcyc := proc (p) local pc: pc := convert(p, disjcyc): nops(pc)+nrfp(p) end proc: b := proc (p) local c: c := [seq(i+1, i = 1 .. nops(p)-1), 1]: [seq(c[p[j]], j = 1 .. nops(p))] end proc: gen := proc (p) options operator, arrow: (1/2)*nops(p)+1/2-(1/2)*nrcyc(p)-(1/2)*nrcyc(b(inv(p))) end proc: NDER := {}: for i to factorial(n) do if nrfp(P[i]) > 0 then NDER := `union`(NDER, {P[i]}) else end if end do: f[n] := sort(add(t^gen(NDER[j]), j = 1 .. nops(NDER))): seq(coeff(f[n], t, j), j = 0 .. floor((1/2)*n)-1); # yields the entries in the specified row n

Extensions

Terms beyond row 7 from Joerg Arndt, Nov 01 2012.

A244455 Number of unlabeled rooted trees with n nodes such that the minimal outdegree of inner nodes equals 1.

Original entry on oeis.org

1, 1, 3, 7, 17, 42, 105, 267, 684, 1775, 4639, 12238, 32491, 86859, 233496, 631082, 1713613, 4673455, 12795426, 35159212, 96927479, 268021520, 743188706, 2066071045, 5757360011, 16079027344, 44997313684, 126166307275, 354384737204, 997083779801, 2809751278062
Offset: 2

Views

Author

Joerg Arndt and Alois P. Heinz, Jun 29 2014

Keywords

Examples

			a(5) = 7:
  o    o      o      o      o      o      o
  |    |      |     / \    / \     |     /|\
  o    o      o    o   o  o   o    o    o o o
  |    |     / \   |      |   |   /|\   |
  o    o    o   o  o      o   o  o o o  o
  |   / \   |      |
  o  o   o  o      o
  |
  o
		

Crossrefs

Column k=1 of A244454.
Cf. A106640 (the same for ordered rooted trees).

Programs

  • Maple
    b:= proc(n, i, t, k) option remember; `if`(n=0, `if`(t in [0, k],
          1, 0), `if`(i<1 or t>n, 0, add(binomial(b((i-1)$2, k$2)+j-1, j)*
          b(n-i*j, i-1, max(0,t-j), k), j=0..n/i)))
        end:
    a:= n-> b(n-1$2, 1$2) -b(n-1$2, 2$2):
    seq(a(n), n=2..35);
  • Mathematica
    b[n_, i_, t_, k_] := b[n, i, t, k] = If[n == 0, If[t == 0 || t == k, 1, 0], If[i < 1, 0, Sum[Binomial[b[i - 1, i - 1, k, k] + j - 1, j]*b[n - i*j, i - 1, Max[0, t - j], k], {j, 0, n/i}]] // FullSimplify]; a[n_] := b[n - 1, n - 1, 1, 1] - b[n - 1, n - 1, 2, 2]; Table[a[n], {n, 2, 35}] (* Jean-François Alcover, Feb 06 2015, after Maple *)

Formula

a(n) = A000081(n) - A001678(n+1).

A247494 Number of crossing partitions of {1,2,...,n} that contain singletons.

Original entry on oeis.org

0, 0, 0, 0, 0, 5, 45, 322, 2086, 13092, 82060, 523116, 3429481, 23279555, 164244262, 1206458632, 9228941572, 73471779239, 608000100209, 5222503739340, 46493341311706, 428345495309624, 4078254436854598, 40073317276815681, 405883920183989049, 4232700263388189325
Offset: 0

Views

Author

Peter Luschny, Oct 02 2014

Keywords

Comments

A partition p of the set {1,2,...,n} whose elements are arranged in their natural order, is crossing if there exist four numbers 1 <= i < k < j < l <= n such that i and j are in the same block, k and l are in the same block, but i,j and k,l belong to two different blocks.
Also number of crossing partitions of {1,2,...,n} that contain cyclical adjacencies. a(5) = 5, [124|35, 134|25, 135|24, 13|245, 14|235]. - Yuchun Ji, Nov 13 2020

Examples

			The crossing partitions of {1,2,3,4,5} that contain singletons are: [1|24|35], [2|14|35], [3|14|25], [4|13|25], [5|13|24].
		

Crossrefs

Programs

  • Maple
    A247494 := n -> add((-1)^(n-k+1)*combinat:-bell(k+1), k=0..n-1) + (-1)^n*hypergeom([-n,1/2],[2],4) - binomial(2*n,n)/(n+1):
    seq(round(evalf(A247494(n),100)), n=0..25);
  • Mathematica
    Table[Sum[(-1)^(n-k+1)*Binomial[n,k]*(BellB[k]-CatalanNumber[k]),{k,0,n-1}],{n,0,25}] (* Indranil Ghosh, Mar 04 2017 *)
  • PARI
    B(n) = sum(k=0, n, stirling(n,k,2));
    a(n) = sum(k=0, n-1, (-1)^(n-k+1)*binomial(n,k)*(B(k) - binomial(2*k,k)/(k+1))); \\ Indranil Ghosh, Mar 04 2017
  • Sage
    A247494 = lambda n: sum((-1)^(n-k+1)*binomial(n,k)*(bell_number(k)-catalan_number(k)) for k in (0..n-1))
    [A247494(n) for n in range(26)]
    

Formula

a(n) = Sum_{k = 0..n-1} (-1)^(n-k+1)*binomial(n,k)*(Bell(k)-Catalan(k)).
a(n) = A016098(n) - A247491(n).
a(n) = A000296(n+1) - A106640(n-1), for n>0 (i.e., remove the non-crossing partitions from the cyclical adjacencies partitions). - Yuchun Ji, Nov 11 2020
Showing 1-5 of 5 results.