|
|
A073267
|
|
Number of compositions (ordered partitions) of n into exactly two powers of 2.
|
|
18
|
|
|
0, 0, 1, 2, 1, 2, 2, 0, 1, 2, 2, 0, 2, 0, 0, 0, 1, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 2, 0, 2, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0, 0, 0, 0, 0, 0
(list;
graph;
refs;
listen;
history;
text;
internal format)
|
|
|
OFFSET
|
0,4
|
|
COMMENTS
|
Starting with 1 = self-convolution of A036987, the characteristic function of the powers of 2. [Gary W. Adamson, Feb 23 2010]
|
|
LINKS
|
|
|
FORMULA
|
|
|
EXAMPLE
|
For 2 there is only composition {1+1}, for 3 there is {1+2, 2+1}, for 4 {2+2}, for 5 {1+4, 4+1}, for 6 {2+4,4+2}, for 7 none, thus a(2)=1, a(3)=2, a(4)=1, a(5)=2, a(6)=2 and a(7)=0.
|
|
MAPLE
|
f:= proc(n) local d;
d:= convert(convert(n, base, 2), `+`);
if d=2 then 2 elif d=1 then 1 else 0 fi
end proc:
|
|
MATHEMATICA
|
Table[Count[Map[{#, n - #} &, Range[0, n]], k_ /; Times @@ Boole@ Map[IntegerQ@ Log2@ # &, k] == 1], {n, 0, 88}] (* Michael De Vlieger, Jul 08 2016 *)
|
|
PROG
|
(Haskell)
a073267 n = sum $ zipWith (*) a209229_list $ reverse $ take n a036987_list
(PARI)
N=166; x='x+O('x^N);
v=Vec( 'a0 + sum(k=0, ceil(log(N)/log(2)), x^(2^k) )^2 );
v[1] -= 'a0; v
|
|
CROSSREFS
|
The second row of the table A073265. The essentially same sequence 1, 1, 2, 1, 2, 2, 0, 1, ... occurs for first time in A073202 as row 105 (the fix count sequence of A073290). The positions of 1's for n > 1 is given by the characteristic function of A000079, i.e. A036987 with offset 1 instead of 0 and the positions of 2's is given by A018900. Cf. also A023359.
|
|
KEYWORD
|
nonn
|
|
AUTHOR
|
|
|
STATUS
|
approved
|
|
|
|