|
EXAMPLE
|
For n=1, we have a(n)=2, because the only 1-tuples are 0 and 1.
For n=2, we have a(2)=5, as the possible 2-tuples are (2,1), (2,0), (1,1), (1,0), (0,0).
For n=3, there are 19 possibilities: (4,2,1), (4,2,0), (4,1,1), (4,1,0), (4,0,0), (3,2,1), (3,2,0), (3,1,1), (3,1,0), (3,0,0), (2,2,1), (2,2,0), (2,1,1), (2,1,0), (2,0,0), (1,1,0), (1,0,0), (0,0,0).
|
|
MAPLE
|
b:= proc(n, i) option remember; `if`(n=0, 1,
add(b(n-1, j), j=0..min(i, 2^(n-1))))
end:
a:= n-> b(n, infinity):
# second Maple program:
a:= proc(n) option remember; `if`(n=0, 1, -add(a(j)
*(-1)^(n-j)*binomial(1+ 2^j, n-j), j=0..n-1))
end:
|