# Partitions into Powers of Two: Solution **Problem setter’s solution: a three-dimensional DP for power-of-two blocks. GPT-6 adds the unique-splitting proof and suffix-sum acceleration.** ## 1. States for one block Let $C_{i,j,k}$ count nondecreasing partitions of $2^j$ with smallest exponent exactly $i$ and largest exponent exactly $k$ . Necessarily $0\le i\le k\le j$ . The unsplit block gives $C_{j,j,j}=1$ . Every other partition uses terms at most $2^{j-1}$ and can be cut uniquely into two consecutive halves of sum $2^{j-1}$ each. To see why a cut cannot be skipped, let the next term be $v$ . All following terms are multiples of $v$ , and the total is also a multiple of $v$ , so the preceding prefix sum is a multiple of $v$ . The target $2^{j-1}$ is likewise a multiple of $v$ . Adding one $v$ cannot jump over it. Positive terms make the cut unique. If the left half’s largest exponent is $l$ and the right half’s smallest exponent is $r$ , sorted order requires $l\le r$ . Thus, for $k