login

Year-end appeal: Please make a donation to the OEIS Foundation to support ongoing development and maintenance of the OEIS. We are now in our 61st year, we have over 378,000 sequences, and we’ve reached 11,000 citations (which often say “discovered thanks to the OEIS”).

A072170
Square array T(n,k) (n >= 0, k >= 2) read by antidiagonals, where T(n,k) is the number of ways of writing n as Sum_{i>=0} c_i 2^i, c_i in {0,1,...,k-1}.
13
1, 1, 1, 1, 1, 1, 1, 2, 1, 1, 1, 1, 2, 1, 1, 1, 3, 2, 2, 1, 1, 1, 2, 3, 2, 2, 1, 1, 1, 3, 3, 4, 2, 2, 1, 1, 1, 1, 4, 3, 4, 2, 2, 1, 1, 1, 4, 4, 5, 4, 4, 2, 2, 1, 1, 1, 3, 5, 4, 5, 4, 4, 2, 2, 1, 1, 1, 5, 5, 8, 5, 6, 4, 4, 2, 2, 1, 1, 1, 2, 6, 6, 8, 5, 6, 4, 4, 2, 2, 1, 1, 1, 5, 6, 9, 8, 9, 6, 6, 4, 4, 2, 2, 1, 1
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
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
k=3 column is A002487, k=4 is A008619 (positive integers repeated), k = 5, 6, 7 are A007728, A007729, A007730, limiting (infinity) column is A000123 doubled up.
Sequence in context: A133912 A277231 A122934 * A373819 A368885 A294932
KEYWORD
nonn,tabl
AUTHOR
N. J. A. Sloane, Jun 29 2002
STATUS
approved