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.
%I A273712 #22 Jan 02 2022 09:47:40 %S A273712 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, %T A273712 0,1,1,120,3892643213082624,35417271278873496315860673177600000000, %U A273712 74836825861835980800000,1,0 %N A273712 Number A(n,k) of k-ary heaps on n levels; square array A(n,k), n>=0, k>=0, read by antidiagonals. %H A273712 Alois P. Heinz, <a href="/A273712/b273712.txt">Antidiagonals n = 0..9, flattened</a> %H A273712 Wikipedia, <a href="https://en.wikipedia.org/wiki/D-ary_heap">D-ary heap</a> %e A273712 Square array A(n,k) begins: %e A273712 1, 1, 1, 1, ... %e A273712 1, 1, 1, 1, ... %e A273712 0, 1, 2, 6, ... %e A273712 0, 1, 80, 7484400, ... %e A273712 0, 1, 21964800, 35417271278873496315860673177600000000, ... %p A273712 with(combinat): %p A273712 b:= proc(n, k) option remember; local h, i, x, y, z; %p A273712 if n<2 then 1 elif k<2 then k %p A273712 else h:= ilog[k]((k-1)*n+1); %p A273712 if k^h=(k-1)*n+1 then b((n-1)/k, k)^k* %p A273712 multinomial(n-1, ((n-1)/k)$k) %p A273712 else x, y:=(k^h-1)/(k-1), (k^(h-1)-1)/(k-1); %p A273712 for i from 0 do z:= (n-1)-(k-1-i)*y-i*x; %p A273712 if y<=z and z<=x then b(y, k)^(k-1-i)* %p A273712 multinomial(n-1, y$(k-1-i), x$i, z)* %p A273712 b(x, k)^i*b(z, k); break fi %p A273712 od %p A273712 fi fi %p A273712 end: %p A273712 A:= (n, k)-> `if`(n<2, 1, `if`(k<2, k, b((k^n-1)/(k-1), k))): %p A273712 seq(seq(A(n,d-n), n=0..d), d=0..7); %t A273712 multinomial[n_, k_List] := n!/Times @@ (k!); %t A273712 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[]]]]]]; %t A273712 A[n_, k_] := If[n<2, 1, If[k<2, k, b[(k^n-1) / (k-1), k]]]; %t A273712 Table[A[n, d-n], {d, 0, 7}, {n, 0, d}] // Flatten (* _Jean-François Alcover_, Jan 24 2017, after _Alois P. Heinz_ *) %Y A273712 Columns k=0-4 give: A019590(n+1), A000012, A056972, A273723, A273725. %Y A273712 Main diagonal gives A273729. %Y A273712 Cf. A273693. %K A273712 nonn,tabl %O A273712 0,13 %A A273712 _Alois P. Heinz_, May 28 2016