Maths Olympiad Prep

Library / /648 of 740

, 2021

Combinatorics Difficulty 5.5 AIME, harder Prove it United States

Problem:
Let XX be the number of sequences of integers a1,a2,,a2047a_{1}, a_{2}, \ldots, a_{2047} that satisfy all of the following properties:
- Each aia_{i} is either 00 or a power of 22.
- ai=a2i+a2i+1a_{i} = a_{2i} + a_{2i+1} for 1i10231 \leq i \leq 1023.
- a1=1024a_{1} = 1024.
Find the remainder when XX is divided by 100100.

Solutions — 2

Solution 1

Solution:
This problem can be visualized as a complete binary tree with 20482048 leaves, such that each node contains the sum of its two children. Let f(p)f(p) be the number of ways to fill in a binary tree with 2p2^{p} leaves and the root having value 2p2^{p}. We want f(10)f(10).

Since all values must be a power of 22, we can set up the recurrence f(p)=2f(p1)+f(p1)2f(p) = 2 f(p-1) + f(p-1)^{2}. This is because we have three cases: either all of the 2p2^{p} can go to the left child of the root (in which case there are f(p1)f(p-1) ways because even though there's 2p2^{p} in the new root, we can treat it as 2p12^{p-1} because none of the leaves will have a value of 11), all of it can go to the right child of the root (another f(p1)f(p-1) ways), or it can be split evenly (f(p1)2f(p-1)^{2} ways).

This recursion can be shown to be f(p)=22p1f(p) = 2^{2^{p}} - 1 by induction. Thus, our answer is 2102412^{1024} - 1 which is 1515 modulo 100100.

Solution 2

Solution:
The simple formula derived in the previous solution hints at a cute bijection. It turns out that the entire tree is determined by the set of leaf nodes that have non-zero value. You can see this is true: start with the root node, then only split the value each time if both subtrees have a non-zero leaf. The entire process is uniquely determined. Thus, the total number of ways is 22 to the number of leaves, minus one for the case where all of the leaves have zero value.

Want a route through all this instead of an archive? The track puts 2,000 problems in a working order, from AMC 10 level to the IMO shortlist.

Source: MathNet, licensed CC-BY-4.0. Statement reproduced verbatim; metadata (topic, difficulty) added by this project.