Subfield: Number Theory


Question: Define the sequence $a_{0}, a_{1}, a_{2}, \ldots$ by $a_{n}=2^{n}+2^{\lfloor n / 2\rfloor}$. Prove that there are infinitely many terms of the sequence which can be expressed as a sum of (two or more) distinct terms of the sequence, as well as infinitely many of those which cannot be expressed in such a way.

Solution:
Call a nonnegative integer representable if it equals the sum of several (possibly 0 or 1) distinct terms of the sequence. We say that two nonnegative integers $b$ and $c$ are equivalent (written as $b \sim c$ ) if they are either both representable or both non-representable.

One can easily compute

$$
S_{n-1}:=a_{0}+\cdots+a_{n-1}=2^{n}+2^{[n / 2\rceil}+2^{\lfloor n / 2\rfloor}-3 .
$$

Indeed, we have $S_{n}-S_{n-1}=2^{n}+2^{\lfloor n / 2\rfloor}=a_{n}$ so we can use the induction. In particular, $S_{2 k-1}=2^{2 k}+2^{k+1}-3$.

Note that, if $n \geqslant 3$, then $2^{[n / 2]} \geqslant 2^{2}>3$, so

$$
S_{n-1}=2^{n}+2^{\lceil n / 2\rceil}+2^{\lfloor n / 2\rfloor}-3>2^{n}+2^{\lfloor n / 2\rfloor}=a_{n} .
$$

Also notice that $S_{n-1}-a_{n}=2^{[n / 2]}-3<a_{n}$.

The main tool of the solution is the following claim.

Claim 1. Assume that $b$ is a positive integer such that $S_{n-1}-a_{n}<b<a_{n}$ for some $n \geqslant 3$. Then $b \sim S_{n-1}-b$.

Proof. As seen above, we have $S_{n-1}>a_{n}$. Denote $c=S_{n-1}-b$; then $S_{n-1}-a_{n}<c<a_{n}$, so the roles of $b$ and $c$ are symmetrical.

Assume that $b$ is representable. The representation cannot contain $a_{i}$ with $i \geqslant n$, since $b<a_{n}$. So $b$ is the sum of some subset of $\left\{a_{0}, a_{1}, \ldots, a_{n-1}\right\}$; then $c$ is the sum of the complement. The converse is obtained by swapping $b$ and $c$.

We also need the following version of this claim.

Claim 2. For any $n \geqslant 3$, the number $a_{n}$ can be represented as a sum of two or more distinct terms of the sequence if and only if $S_{n-1}-a_{n}=2^{[n / 2]}-3$ is representable.

Proof. Denote $c=S_{n-1}-a_{n}<a_{n}$. If $a_{n}$ satisfies the required condition, then it is the sum of some subset of $\left\{a_{0}, a_{1}, \ldots, a_{n-1}\right\}$; then $c$ is the sum of the complement. Conversely, if $c$ is representable, then its representation consists only of the numbers from $\left\{a_{0}, \ldots, a_{n-1}\right\}$, so $a_{n}$ is the sum of the complement.

By Claim 2, in order to prove the problem statement, it suffices to find infinitely many representable numbers of the form $2^{t}-3$, as well as infinitely many non-representable ones.

Claim 3. For every $t \geqslant 3$, we have $2^{t}-3 \sim 2^{4 t-6}-3$, and $2^{4 t-6}-3>2^{t}-3$.

Proof. The inequality follows from $t \geqslant 3$. In order to prove the equivalence, we apply Claim 1 twice in the following manner.

First, since $S_{2 t-3}-a_{2 t-2}=2^{t-1}-3<2^{t}-3<2^{2 t-2}+2^{t-1}=a_{2 t-2}$, by Claim 1 we have $2^{t}-3 \sim S_{2 t-3}-\left(2^{t}-3\right)=2^{2 t-2}$.

Second, since $S_{4 t-7}-a_{4 t-6}=2^{2 t-3}-3<2^{2 t-2}<2^{4 t-6}+2^{2 t-3}=a_{4 t-6}$, by Claim 1 we have $2^{2 t-2} \sim S_{4 t-7}-2^{2 t-2}=2^{4 t-6}-3$.

Therefore, $2^{t}-3 \sim 2^{2 t-2} \sim 2^{4 t-6}-3$, as required.

Now it is easy to find the required numbers. Indeed, the number $2^{3}-3=5=a_{0}+a_{1}$ is representable, so Claim 3 provides an infinite sequence of representable numbers

$$
2^{3}-3 \sim 2^{6}-3 \sim 2^{18}-3 \sim \cdots \sim 2^{t}-3 \sim 2^{4 t-6}-3 \sim \cdots
$$

On the other hand, the number $2^{7}-3=125$ is non-representable (since by Claim 1 we have $125 \sim S_{6}-125=24 \sim S_{4}-24=17 \sim S_{3}-17=4$ which is clearly non-representable). So Claim 3 provides an infinite sequence of non-representable numbers

$$
2^{7}-3 \sim 2^{22}-3 \sim 2^{82}-3 \sim \cdots \sim 2^{t}-3 \sim 2^{4 t-6}-3 \sim \cdots
$$
We keep the notion of representability and the notation $S_{n}$ from the previous solution. We say that an index $n$ is good if $a_{n}$ writes as a sum of smaller terms from the sequence $a_{0}, a_{1}, \ldots$ Otherwise we say it is bad. We must prove that there are infinitely many good indices, as well as infinitely many bad ones.

Lemma 1. If $m \geqslant 0$ is an integer, then $4^{m}$ is representable if and only if either of $2 m+1$ and $2 m+2$ is good.

Proof. The case $m=0$ is obvious, so we may assume that $m \geqslant 1$. Let $n=2 m+1$ or $2 m+2$. Then $n \geqslant 3$. We notice that

$$
S_{n-1}<a_{n-2}+a_{n}
$$

The inequality writes as $2^{n}+2^{[n / 2]}+2^{\lfloor n / 2\rfloor}-3<2^{n}+2^{\lfloor n / 2\rfloor}+2^{n-2}+2^{\lfloor n / 2\rfloor-1}$, i.e. as $2^{[n / 2\rceil}<$ $2^{n-2}+2^{\lfloor n / 2\rfloor-1}+3$. If $n \geqslant 4$, then $n / 2 \leqslant n-2$, so $[n / 2\rceil \leqslant n-2$ and $2^{[n / 2\rfloor} \leqslant 2^{n-2}$. For $n=3$ the inequality verifies separately.

If $n$ is good, then $a_{n}$ writes as $a_{n}=a_{i_{1}}+\cdots+a_{i_{r}}$, where $r \geqslant 2$ and $i_{1}<\cdots<i_{r}<n$. Then $i_{r}=n-1$ and $i_{r-1}=n-2$, for if $n-1$ or $n-2$ is missing from the sequence $i_{1}, \ldots, i_{r}$, then $a_{i_{1}}+\cdots+a_{i_{r}} \leqslant a_{0}+\cdots+a_{n-3}+a_{n-1}=S_{n-1}-a_{n-2}<a_{n}$. Thus, if $n$ is good, then both $a_{n}-a_{n-1}$ and $a_{n}-a_{n-1}-a_{n-2}$ are representable.

We now consider the cases $n=2 m+1$ and $n=2 m+2$ separately.

If $n=2 m+1$, then $a_{n}-a_{n-1}=a_{2 m+1}-a_{2 m}=\left(2^{2 m+1}+2^{m}\right)-\left(2^{2 m}+2^{m}\right)=2^{2 m}$. So we proved that, if $2 m+1$ is good, then $2^{2 m}$ is representable. Conversely, if $2^{2 m}$ is representable, then $2^{2 m}<a_{2 m}$, so $2^{2 m}$ is a sum of some distinct terms $a_{i}$ with $i<2 m$. It follows that $a_{2 m+1}=a_{2 m}+2^{2 m}$ writes as $a_{2 m}$ plus a sum of some distinct terms $a_{i}$ with $i<2 m$. Hence $2 m+1$ is good.

If $n=2 m+2$, then $a_{n}-a_{n-1}-a_{n-2}=a_{2 m+2}-a_{2 m+1}-a_{2 m}=\left(2^{2 m+2}+2^{m+1}\right)-\left(2^{2 m+1}+\right.$ $\left.2^{m}\right)-\left(2^{2 m}+2^{m}\right)=2^{2 m}$. So we proved that, if $2 m+2$ is good, then $2^{2 m}$ is representable. Conversely, if $2^{2 m}$ is representable, then, as seen in the previous case, it writes as a sum of some distinct terms $a_{i}$ with $i<2 m$. Hence $a_{2 m+2}=a_{2 m+1}+a_{2 m}+2^{2 m}$ writes as $a_{2 m+1}+a_{2 m}$ plus a sum of some distinct terms $a_{i}$ with $i<2 m$. Thus $2 m+2$ is good.

Lemma 2. If $k \geqslant 2$, then $2^{4 k-2}$ is representable if and only if $2^{k+1}$ is representable.

In particular, if $s \geqslant 2$, then $4^{s}$ is representable if and only if $4^{4 s-3}$ is representable. Also, $4^{4 s-3}>4^{s}$.

Proof. We have $2^{4 k-2}<a_{4 k-2}$, so in a representation of $2^{4 k-2}$ we can have only terms $a_{i}$ with $i \leqslant 4 k-3$. Notice that

$$
a_{0}+\cdots+a_{4 k-3}=2^{4 k-2}+2^{2 k}-3<2^{4 k-2}+2^{2 k}+2^{k}=2^{4 k-2}+a_{2 k} .
$$

Hence, any representation of $2^{4 k-2}$ must contain all terms from $a_{2 k}$ to $a_{4 k-3}$. (If any of these terms is missing, then the sum of the remaining ones is $\leqslant\left(a_{0}+\cdots+a_{4 k-3}\right)-a_{2 k}<2^{4 k-2}$.) Hence, if $2^{4 k-2}$ is representable, then $2^{4 k-2}-\sum_{i=2 k}^{4 k-3} a_{i}$ is representable. But

$2^{4 k-2}-\sum_{i=2 k}^{4 k-3} a_{i}=2^{4 k-2}-\left(S_{4 k-3}-S_{2 k-1}\right)=2^{4 k-2}-\left(2^{4 k-2}+2^{2 k}-3\right)+\left(2^{2 k}+2^{k+1}-3\right)=2^{k+1}$.

So, if $2^{4 k-2}$ is representable, then $2^{k+1}$ is representable. Conversely, if $2^{k+1}$ is representable, then $2^{k+1}<2^{2 k}+2^{k}=a_{2 k}$, so $2^{k+1}$ writes as a sum of some distinct terms $a_{i}$ with $i<2 k$. It follows that $2^{4 k-2}=\sum_{i=2 k}^{4 k-3} a_{i}+2^{k+1}$ writes as $a_{4 k-3}+a_{4 k-4}+\cdots+a_{2 k}$ plus the sum of some distinct terms $a_{i}$ with $i<2 k$. Hence $2^{4 k-2}$ is representable.

For the second statement, if $s \geqslant 2$, then we just take $k=2 s-1$ and we notice that $2^{k+1}=4^{s}$ and $2^{4 k-2}=4^{4 s-3}$. Also, $s \geqslant 2$ implies that $4 s-3>s$.

Now $4^{2}=a_{2}+a_{3}$ is representable, whereas $4^{6}=4096$ is not. Indeed, note that $4^{6}=2^{12}<a_{12}$, so the only available terms for a representation are $a_{0}, \ldots, a_{11}$, i.e., $2,3,6,10,20,36,72$, 136, 272, 528, 1056, 2080. Their sum is $S_{11}=4221$, which exceeds 4096 by 125 . Then any representation of 4096 must contain all the terms from $a_{0}, \ldots, a_{11}$ that are greater that 125, i.e., $136,272,528,1056,2080$. Their sum is 4072 . Since $4096-4072=24$ and 24 is clearly not representable, 4096 is non-representable as well.

Starting with these values of $m$, by using Lemma 2, we can obtain infinitely many representable powers of 4 , as well as infinitely many non-representable ones. By Lemma 1, this solves our problem.