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.

A214257 Number A(n,k) of compositions of n where the difference between largest and smallest parts is <= k; square array A(n,k), n>=0, k>=0, read by antidiagonals.

This page as a plain text file.
%I A214257 #22 Jan 05 2019 14:51:14
%S A214257 1,1,1,1,1,2,1,1,2,2,1,1,2,4,3,1,1,2,4,6,2,1,1,2,4,8,11,4,1,1,2,4,8,
%T A214257 14,15,2,1,1,2,4,8,16,27,27,4,1,1,2,4,8,16,30,47,39,3,1,1,2,4,8,16,32,
%U A214257 59,88,63,4,1,1,2,4,8,16,32,62,111,158,100,2
%N A214257 Number A(n,k) of compositions of n where the difference between largest and smallest parts is <= k; square array A(n,k), n>=0, k>=0, read by antidiagonals.
%H A214257 Alois P. Heinz, <a href="/A214257/b214257.txt">Antidiagonals n = 0..150, flattened</a>
%F A214257 T(n,k) = Sum_{i=0..k} A214258(n,i).
%e A214257 A(3,0) =  2: [3], [1,1,1].
%e A214257 A(4,1) =  6: [4], [2,2], [2,1,1], [1,2,1], [1,1,2], [1,1,1,1].
%e A214257 A(5,1) =  8: [5], [3,2], [2,3], [2,2,1], [2,1,2], [2,1,1,1], [1,2,2], [1,2,1,1], [1,1,2,1], [1,1,1,2], [1,1,1,1,1],
%e A214257 A(5,2) = 14: [5], [3,2], [3,1,1], [2,3], [2,2,1], [2,1,2], [2,1,1,1], [1,3,1], [1,2,2], [1,2,1,1], [1,1,3], [1,1,2,1], [1,1,1,2], [1,1,1,1,1].
%e A214257 Square array A(n,k) begins:
%e A214257   1,  1,  1,  1,  1,  1,  1,  1, ...
%e A214257   1,  1,  1,  1,  1,  1,  1,  1, ...
%e A214257   2,  2,  2,  2,  2,  2,  2,  2, ...
%e A214257   2,  4,  4,  4,  4,  4,  4,  4, ...
%e A214257   3,  6,  8,  8,  8,  8,  8,  8, ...
%e A214257   2, 11, 14, 16, 16, 16, 16, 16, ...
%e A214257   4, 15, 27, 30, 32, 32, 32, 32, ...
%e A214257   2, 27, 47, 59, 62, 64, 64, 64, ...
%p A214257 b:= proc(n, k, s, t) option remember;
%p A214257       `if`(n<0, 0, `if`(n=0, 1, add(b(n-j, k,
%p A214257        min(s,j), max(t,j)), j=max(1, t-k+1)..s+k-1)))
%p A214257     end:
%p A214257 A:= (n, k)-> `if`(n=0, 1, add(b(n-j, k+1, j, j), j=1..n)):
%p A214257 seq(seq(A(n, d-n), n=0..d), d=0..11);
%p A214257 # second Maple program:
%p A214257 b:= proc(n, s, t) option remember; `if`(n=0, x^(t-s),
%p A214257       add(b(n-j, min(s, j), max(t, j)), j=1..n))
%p A214257     end:
%p A214257 T:= (n, k)-> coeff(b(n$2, 0), x, k):
%p A214257 A:= proc(n, k) option remember; `if`(k<0, 0,
%p A214257       `if`(k>n, A(n$2), A(n, k-1)+T(n, k)))
%p A214257     end:
%p A214257 seq(seq(A(n, d-n), n=0..d), d=0..11);  # _Alois P. Heinz_, Jan 05 2019
%t A214257 b[n_, k_, s_, t_] := b[n, k, s, t] = If[n < 0, 0, If[n == 0, 1, Sum [b[n - j, k, Min[s, j], Max[t, j]], {j, Max[1, t - k + 1], s + k - 1}]]]; A[n_, k_] := If[n == 0, 1, Sum[b[n - j, k + 1, j, j], {j, 1, n}]]; Table[Table[A[n, d - n], {n, 0, d}], {d, 0, 11}] // Flatten (* _Jean-François Alcover_, Dec 27 2013, translated from Maple *)
%Y A214257 Columns k=0-1 give: A000005, A072951.
%Y A214257 Main diagonal gives: A011782.
%Y A214257 Cf. A214246, A214247, A214248, A214249, A214258, A214268, A214269.
%K A214257 nonn,tabl
%O A214257 0,6
%A A214257 _Alois P. Heinz_, Jul 08 2012