A056971 Number of (binary) heaps on n elements.
1, 1, 1, 2, 3, 8, 20, 80, 210, 896, 3360, 19200, 79200, 506880, 2745600, 21964800, 108108000, 820019200, 5227622400, 48881664000, 319258368000, 3143467008000, 25540669440000, 299677188096000, 2261626278912000, 25732281217843200, 241240136417280000
Offset: 0
A273730 Square array read by antidiagonals: A(n,k) = number of permutations of n elements divided by the number of k-ary heaps on n+1 elements, n>=0, k>=1.
1, 1, 1, 1, 1, 2, 1, 1, 1, 6, 1, 1, 1, 2, 24, 1, 1, 1, 1, 3, 120, 1, 1, 1, 1, 2, 6, 720, 1, 1, 1, 1, 1, 3, 9, 5040, 1, 1, 1, 1, 1, 2, 4, 24, 40320, 1, 1, 1, 1, 1, 1, 3, 8, 45, 362880, 1, 1, 1, 1, 1, 1, 2, 4, 12, 108, 3628800, 1, 1, 1, 1, 1, 1, 1, 3, 5, 16, 189, 39916800
Offset: 0
Examples
Square array A(n,k) begins: : 1, 1, 1, 1, 1, 1, 1, 1, ... : 1, 1, 1, 1, 1, 1, 1, 1, ... : 2, 1, 1, 1, 1, 1, 1, 1, ... : 6, 2, 1, 1, 1, 1, 1, 1, ... : 24, 3, 2, 1, 1, 1, 1, 1, ... : 120, 6, 3, 2, 1, 1, 1, 1, ... : 720, 9, 4, 3, 2, 1, 1, 1, ... : 5040, 24, 8, 4, 3, 2, 1, 1, ... : 40320, 45, 12, 5, 4, 3, 2, 1, ...
Links
- Alois P. Heinz, Antidiagonals n = 0..140, flattened
- Wikipedia, D-ary heap
Crossrefs
Programs
-
Maple
with(combinat): b:= proc(n, k) option remember; local h, i, x, y, z; if n<2 then 1 elif k<2 then k else h:= ilog[k]((k-1)*n+1); if k^h=(k-1)*n+1 then b((n-1)/k, k)^k* multinomial(n-1, ((n-1)/k)$k) else x, y:=(k^h-1)/(k-1), (k^(h-1)-1)/(k-1); for i from 0 do z:= (n-1)-(k-1-i)*y-i*x; if y<=z and z<=x then b(y, k)^(k-1-i)* multinomial(n-1, y$(k-1-i), x$i, z)* b(x, k)^i*b(z, k); break fi od fi fi end: A:= (n, k)-> n!/b(n+1, k): seq(seq(A(n, 1+d-n), n=0..d), d=0..14);
-
Mathematica
multinomial[n_, k_List] := n!/Times @@ (k!); b[n_, k_] := b[n, k] = Module[{h, i, x, y, z}, Which[n<2, 1, k<2, k, True, h = Floor @ Log[k, (k - 1)*n + 1]; If [k^h == (k-1)*n+1, b[(n-1)/k, k]^k*multinomial[n-1, Array[(n-1)/k&, k]], {x, y} = {(k^h-1)/(k-1), (k^(h-1)-1)/(k-1)}; For[i = 0, True, i++, z = (n-1) - (k-1-i)*y - i*x; If[y <= z && z <= x, b[y, k]^(k-1-i)*multinomial[n-1, Join[Array[y&, k-1-i], Array[x&, i], {z}]] * b[x, k]^i*b[z, k] // Return]]]]]; A[n_, k_] := n!/b[n+1, k]; Table[A[n, 1+d-n], {d, 0, 14}, {n, 0, d}] // Flatten (* Jean-François Alcover, Mar 13 2017, translated from Maple *)
A273712 Number A(n,k) of k-ary heaps on n levels; square array A(n,k), n>=0, k>=0, read by antidiagonals.
1, 1, 1, 1, 1, 0, 1, 1, 1, 0, 1, 1, 2, 1, 0, 1, 1, 6, 80, 1, 0, 1, 1, 24, 7484400, 21964800, 1, 0, 1, 1, 120, 3892643213082624, 35417271278873496315860673177600000000, 74836825861835980800000, 1, 0
Offset: 0
Examples
Square array A(n,k) begins: 1, 1, 1, 1, ... 1, 1, 1, 1, ... 0, 1, 2, 6, ... 0, 1, 80, 7484400, ... 0, 1, 21964800, 35417271278873496315860673177600000000, ...
Links
- Alois P. Heinz, Antidiagonals n = 0..9, flattened
- Wikipedia, D-ary heap
Crossrefs
Programs
-
Maple
with(combinat): b:= proc(n, k) option remember; local h, i, x, y, z; if n<2 then 1 elif k<2 then k else h:= ilog[k]((k-1)*n+1); if k^h=(k-1)*n+1 then b((n-1)/k, k)^k* multinomial(n-1, ((n-1)/k)$k) else x, y:=(k^h-1)/(k-1), (k^(h-1)-1)/(k-1); for i from 0 do z:= (n-1)-(k-1-i)*y-i*x; if y<=z and z<=x then b(y, k)^(k-1-i)* multinomial(n-1, y$(k-1-i), x$i, z)* b(x, k)^i*b(z, k); break fi od fi fi end: A:= (n, k)-> `if`(n<2, 1, `if`(k<2, k, b((k^n-1)/(k-1), k))): seq(seq(A(n,d-n), n=0..d), d=0..7);
-
Mathematica
multinomial[n_, k_List] := n!/Times @@ (k!); b[n_, k_] := b[n, k] = Module[{h, i, x, y, z}, Which[n<2, 1, k<2, k, True, h = Log[k, (k-1)*n+1] // Floor; If[k^h == (k-1)*n+1, b[(n-1)/k, k]^k*multinomial[n-1, Array[(n-1)/k&, k]], {x, y} := {(k^h-1)/(k-1), (k^(h-1)-1)/(k-1)}; For[i = 0, True, i++, z = (n-1) - (k-1-i)*y - i*x; If[y <= z && z <= x, b[y, k]^(k-1-i) * multinomial[n-1, Join[Array[y&, k-1-i], Array[x&, i], {z}]]*b[x, k]^i * b[z, k]; Break[]]]]]]; A[n_, k_] := If[n<2, 1, If[k<2, k, b[(k^n-1) / (k-1), k]]]; Table[A[n, d-n], {d, 0, 7}, {n, 0, d}] // Flatten (* Jean-François Alcover, Jan 24 2017, after Alois P. Heinz *)
A178008
Number of permutations of 1..n with no element e[i>=2]
1, 1, 1, 2, 6, 12, 40, 180, 630, 3360, 22680, 113400, 831600, 7484400, 38918880, 302702400, 2918916000, 20432412000, 205837632000, 2500927228800, 21598916976000, 263986763040000, 3837961401120000, 33774060329856000, 431557437548160000, 6658314750743040000
Offset: 0
Keywords
Comments
a(n) is also the number of labeled histories for the trifurcating labeled topology that possesses the largest number of labeled histories, among all labeled topologies with 2n+1 leaves. - Noah A Rosenberg, Feb 24 2025
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..502
- E. H. Dickey, N. A. Rosenberg, Labelled histories with multifurcation and simultaneity, Phil. Trans. R. Soc. B 380 (2025), 20230307.
- Wikipedia, D-ary heap
Extensions
a(0), a(21)-a(25) from Alois P. Heinz, May 27 2016
A178009
Number of permutations of 1..n with no element e[i>=2]
1, 1, 1, 2, 6, 24, 60, 240, 1260, 8064, 36288, 241920, 1995840, 19160064, 124540416, 1162377216, 13076743680, 167382319104, 1422749712384, 17072996548608, 243290200817664, 3892643213082624, 34060628114472960, 428190753439088640, 6463004184721244160
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..491
- Wikipedia, D-ary heap
Extensions
a(0), a(20)-a(24) from Alois P. Heinz, May 27 2016
A178010
Number of permutations of 1..n with no element e[i>=2]
1, 1, 1, 2, 6, 24, 120, 360, 1680, 10080, 72576, 604800, 3326400, 26611200, 259459200, 2905943040, 36324288000, 290594304000, 3293402112000, 44460928512000, 675806113382400, 11263435223040000, 118266069841920000, 1734569024348160000, 29921315670005760000
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..484
- Wikipedia, D-ary heap
Extensions
a(0), a(21)-a(24) from Alois P. Heinz, May 27 2016
A178011
Number of permutations of 1..n with no element e[i>=2]
1, 1, 1, 2, 6, 24, 120, 720, 2520, 13440, 90720, 725760, 6652800, 68428800, 444787200, 4151347200, 46702656000, 597793996800, 8468748288000, 130660687872000, 1241276534784000, 16550353797120000, 260668072304640000, 4587758072561664000, 87932029724098560000
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..479
- Wikipedia, D-ary heap
Extensions
a(0), a(21)-a(24) from Alois P. Heinz, May 27 2016
A273694 Number of 7-ary heaps on n elements.
1, 1, 1, 2, 6, 24, 120, 720, 5040, 20160, 120960, 907200, 7983360, 79833600, 889574400, 10897286400, 81729648000, 871782912000, 11115232128000, 160059342643200, 2534272925184000, 43444678717440000, 798295971432960000, 8781255685762560000, 134645920515025920000
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..476
- Wikipedia, D-ary heap
Crossrefs
Column k=7 of A273693.
A273695 Number of 8-ary heaps on n elements.
1, 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 181440, 1209600, 9979200, 95800320, 1037836800, 12454041600, 163459296000, 2324754432000, 19760412672000, 237124952064000, 3379030566912000, 54064489070592000, 946128558735360000, 17841281393295360000
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..474
- Wikipedia, D-ary heap
Crossrefs
Column k=8 of A273693.
A273696 Number of 9-ary heaps on n elements.
1, 1, 1, 2, 6, 24, 120, 720, 5040, 40320, 362880, 1814400, 13305600, 119750400, 1245404160, 14529715200, 186810624000, 2615348736000, 39520825344000, 640237370572800, 6082255020441600, 81096733605888000, 1277273554292736000, 22480014555552153600
Offset: 0
Keywords
Links
- Alois P. Heinz, Table of n, a(n) for n = 0..472
- Wikipedia, D-ary heap
Crossrefs
Column k=9 of A273693.
Comments
Examples
Links
Crossrefs
Programs
Maple
Mathematica
Python
Formula
Extensions