[go: up one dir, main page]

login
Number A(n,k) of compositions of n where differences between neighboring parts are in {-k,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals.
12

%I #42 Oct 16 2024 22:28:36

%S 1,1,1,1,1,2,1,1,1,2,1,1,1,3,3,1,1,1,1,2,2,1,1,1,1,3,4,4,1,1,1,1,1,2,

%T 5,2,1,1,1,1,1,3,3,5,4,1,1,1,1,1,1,2,2,7,3,1,1,1,1,1,1,3,3,6,10,4,1,1,

%U 1,1,1,1,1,2,1,4,9,2

%N Number A(n,k) of compositions of n where differences between neighboring parts are in {-k,k}; square array A(n,k), n>=0, k>=0, read by antidiagonals.

%H Alois P. Heinz, <a href="/A214247/b214247.txt">Antidiagonals n = 0..140</a>

%F G.f. for column k > 0: A(k,q) is A(k,q,t) = Sum_{n,m>=0} (q^n)*(t^m) under the transform (q^n)*(t^m) -> (q^n)/(1-q^m) for all m > 0 where A(k,q,t) = 1 + Sum_{i>=0} ( t^((2*i)+1) * Cw(i,k,q) * (Sum_{j>=0} (Product_{u=1..j} (Sum_{v>=0} t^((2*v)+1) * q^(((2*v)+1)*k*u) * Cw(v,k,q))))^2 ), Cw(i,k,q) = q^(((k+2)*i)+1) * Ca(i,q^(2*k)), and Ca(i,q) is the i-th Carlitz-Riordan q-Catalan number (i-th row polynomial of A227543). - _John Tyler Rascoe_, Sep 13 2024

%e A(5,0) = 2: [5], [1,1,1,1,1].

%e A(5,1) = 4: [5], [3,2], [2,3], [2,1,2].

%e A(5,2) = 2: [5], [1,3,1].

%e A(5,3) = 3: [5], [4,1], [1,4].

%e Square array A(n,k) begins:

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, ...

%e 1, 1, 1, 1, 1, 1, 1, 1, 1, ...

%e 2, 1, 1, 1, 1, 1, 1, 1, 1, ...

%e 2, 3, 1, 1, 1, 1, 1, 1, 1, ...

%e 3, 2, 3, 1, 1, 1, 1, 1, 1, ...

%e 2, 4, 2, 3, 1, 1, 1, 1, 1, ...

%e 4, 5, 3, 2, 3, 1, 1, 1, 1, ...

%e 2, 5, 2, 3, 2, 3, 1, 1, 1, ...

%e 4, 7, 6, 1, 3, 2, 3, 1, 1, ...

%p b:= proc(n, i, k) option remember;

%p `if`(n<1 or i<1, 0, `if`(n=i, 1, add(b(n-i, i+j, k), j={-k, k})))

%p end:

%p A:= (n, k)-> `if`(n=0, 1, add(b(n, j, k), j=1..n)):

%p seq(seq(A(n, d-n), n=0..d), d=0..15);

%t b[n_, i_, k_] := b[n, i, k] = If[n < 1 || i < 1, 0, If[n == i, 1, Sum[b[n - i, i + j, k], { j, Union[{-k, k}]}]]]; a[n_, k_] := If[n == 0, 1, Sum[b[n, j, k], {j, 1, n}]]; Table[Table[a[n, d - n], {n, 0, d}], {d, 0, 15}] // Flatten (* _Jean-François Alcover_, Dec 13 2013, translated from Maple *)

%o (PARI)

%o tri(k) = {(k*(k+1)/2)}

%o ra(n) = {(sqrt(1+8*n)-1)/2}

%o C(q,n) = {c = if(n<=1, return(1)); return(sum(i=0, n-1, C(q, i) * C(q, n-1-i) * q^((i+1)*(n-1 -i))));}

%o Cw_q(i,k) = {return(q^(((k+2)*i)+1) * polrecip(C(q^(2*k),i)))}

%o A_qt(k,N) = {1 + sum(i=0,N/(k+1), t^((2*i)+1) * Cw_q(i,k) * (sum(j=0,ra(N+2)+1, prod(u=1,j, sum(v=0,(N-(tri(u)*k))/(k+2), t^((2*v)+1) * q^(((2*v)+1)*u*k) * Cw_q(v,k)))))^2)}

%o A_q(k,N) = {my(q='q+O('q^N), Aqt = A_qt(k,N), Aq = 1); for(i=1,poldegree(Aqt,t), Aq += polcoef(Aqt,i,t)/(1-q^i)); Aq}

%o A214247_array(maxrow,maxcolumn) = {my(m=concat([1],vector(maxrow,n,numdiv(n)))~); for(k=1,maxcolumn, m = matconcat([m,Vec(A_q(k,maxrow))~])); m}

%o A214247_array(10,10) \\ _John Tyler Rascoe_, Oct 15 2024

%Y Columns k=0-2 give: A000005, A173258, A214254.

%Y Rows n=0, 1 and main diagonal give: A000012.

%Y Cf. A000108, A214246, A214248, A214249, A214257, A214258, A214268, A214269, A227543.

%K nonn,tabl,look

%O 0,6

%A _Alois P. Heinz_, Jul 08 2012