OFFSET
1,8
LINKS
Alois P. Heinz, Antidiagonals n = 1..141, flattened
S. Lehr, J. Shallit and J. Tromp, On the vector space of the automatic reals, Theoret. Comput. Sci. 163 (1996), no. 1-2, 193-210.
FORMULA
T(0, k) = T(n, 0) = 0, T(n, k) = 0 if k > n, T(n, 1) = 1 if n = 2^m, 0 otherwise and in other cases T(n, k) = Sum_{i=0..floor(log_2(n-1))} T(n-(2^i), k-1).
T(n, k) is the coefficient of x^n in the formal power series (x + x^2 + x^4 + x^8 + x^16 + ...)^k. - Emeric Deutsch, Feb 04 2005
EXAMPLE
T(6,3) = 4 because there are four ordered partitions of 6 into 3 powers of 2, namely: 4+1+1, 1+4+1, 1+1+4 and 2+2+2 and it is recursively computed from T(5,2)+T(4,2)+T(2,2) = 2+1+1.
MAPLE
T:= proc(n, k) option remember; `if`(k>n, 0,
`if`(n=k, 1, add(T(n-2^j, k-1), j=0..ilog2(n))))
end:
seq(seq(T(d-k+1, k), k=1..d), d=1..20); # Alois P. Heinz, Mar 26 2014
MATHEMATICA
T[n_, k_] := If[k>n, 0, SeriesCoefficient[Sum[x^(2^j), {j, 0, Log[2, n] // Ceiling} ]^k, {x, 0, n}]]; Table[T[n-k+1, k], {n, 1, 20}, {k, 1, n}] // Flatten (* Jean-François Alcover, Mar 06 2015, after Emeric Deutsch *)
CROSSREFS
KEYWORD
nonn,tabl
AUTHOR
Antti Karttunen, Jun 25 2002
STATUS
approved