OFFSET
0,8
COMMENTS
k-th column is k-th binary partition function.
The sequence data corresponds (via the table link) to the transpose of the array shown in example and given by the definition. - M. F. Hasler, Feb 14 2019
LINKS
Alois P. Heinz, Antidiagonals n = 0..140, flattened
B. Reznick, Some binary partition functions, in "Analytic number theory" (Conf. in honor P. T. Bateman, Allerton Park, IL, 1989), 451-477, Progr. Math., 85, Birkhäuser Boston, Boston, MA, 1990.
FORMULA
T(n,k) = T(n,n+1) = T(n,n)+1 = A000123(floor(n/2)) for all k >= n+1. - M. F. Hasler, Feb 14 2019
EXAMPLE
Array begins: (rows n >= 0, columns k >= 2)
1 1 1 1 1 1 1 1 ...
1 1 1 1 1 1 1 1 ...
1 2 2 2 2 2 2 2 ...
1 1 2 2 2 2 2 2 ...
1 3 3 4 4 4 4 4 ...
1 2 3 3 4 4 4 4 ...
1 3 4 5 5 6 6 6 ...
MAPLE
b:= proc(n, i, k) option remember;
`if`(n=0, 1, `if`(i<0, 0, add(`if`(n-j*2^i<0, 0,
b(n-j*2^i, i-1, k)), j=0..k-1)))
end:
T:= (n, k)-> b(n, ilog2(n), k):
seq(seq(T(d+2-k, k), k=2..d+2), d=0..14); # Alois P. Heinz, Jun 21 2012
MATHEMATICA
b[n_, i_, k_] := b[n, i, k] = If[n == 0, 1, If[i < 0, 0, Sum[If[n-j*2^i < 0, 0, b[n-j*2^i, i-1, k]], {j, 0, k-1}]]];
t[n_, k_] := b[n, Length[IntegerDigits[n, 2]] - 1, k];
Table[Table[t[d+2-k, k], {k, 2, d+2}], {d, 0, 14}] // Flatten (* Jean-François Alcover, Jan 14 2014, translated from Alois P. Heinz's Maple code *)
PROG
(PARI) M72170=[[]]; A072170(n, k, i=logint(n+!n, 2), r=1)={if( !i, k>n, r&&(k<5||k>=n), if(k>4, A000123(n\2)-(k==n), k<3, 1, k<4, A002487(n), n\2+1), M72170[r=setsearch(M72170, [n, k, i, ""], 1)-1][^-1]==[n, k, i], M72170[r][4], M72170=setunion(M72170, [[n, k, i, r=sum(j=0, min(k-1, n>>i), A072170(n-j*2^i, k, i-1, 0))]]); r)} \\ Code for k<5 (using A002487 for k=3) and k>=n (using A000123) is optional but makes it about 3x faster. - M. F. Hasler, Feb 14 2019
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
N. J. A. Sloane, Jun 29 2002
STATUS
approved