Task 3. Determine all positive integers that cannot be written as $\frac{a}{b}+\frac{a+1}{b+1}$ with $a, b$ positive and integer.
Solution. It holds that

$$
\frac{a}{b}+\frac{a+1}{b+1}=\frac{2 a b+a+b}{b(b+1)}
$$

Assume that this is equal to an integer $n$. Then $b \mid 2 a b+a+b$ and $b+1 \mid 2 a b+a+b$. From the first, it follows that $b \mid a$ and thus also $b \mid a-b$. From the second, it follows that $b+1 \mid (2 a b+a+b) - (b+1) \cdot 2a = -a + b$, so also $b+1 \mid a-b$. Since the greatest common divisor of $b$ and $b+1$ is 1, we can conclude that $b(b+1) \mid a-b$. We can thus write $a$ as $a = b(b+1) \cdot k + b$. Since $a$ must be positive, $k$ must be a non-negative integer. Substituting this in, we get:

$$
\begin{aligned}
n & =\frac{2 a b+a+b}{b(b+1)} \\
& =\frac{2 \cdot (b(b+1) \cdot k + b) \cdot b + (b(b+1) \cdot k + b) + b}{b(b+1)} \\
& =\frac{b(b+1) \cdot (2 k b + k) + 2 b^2 + 2 b}{b(b+1)} \\
& =(2 b + 1) k + 2.
\end{aligned}
$$

Thus, $n$ is of the form $n = (2 b + 1) k + 2$. From this, we see that $n \geq 2$ (since $k \geq 0$) and that $n-2$ must be divisible by an odd number greater than 1 (namely $2 b + 1 \geq 3$).

Conversely, suppose that for a number $n$ it holds that $n \geq 2$ and $n-2$ is divisible by an odd number greater than 1, say by $2 b + 1$ with $b \geq 1$ and integer. Then there is a $k \geq 0$ such that $n = (2 b + 1) k + 2$. Choose now $a = b(b+1) \cdot k + b$, then $a$ is a positive integer and it holds that

$$
\frac{a}{b}+\frac{a+1}{b+1} = ((b+1) k + 1) + (b k + 1) = (2 b + 1) k + 2 = n.
$$

We can now conclude that the numbers that can be written as $\frac{a}{b}+\frac{a+1}{b+1}$ with $a$ and $b$ positive integers are exactly the numbers $n \geq 2$ for which $n-2$ is divisible by an odd number greater than 1. The numbers that cannot be written in this way are thus exactly 1 and the numbers $n \geq 2$ for which $n-2$ has no odd divisor greater than 1, i.e., for which $n-2$ is a power of two $2^m$ with $m \geq 0$.

We conclude that the numbers that cannot be written as $\frac{a}{b}+\frac{a+1}{b+1}$ are exactly 1 and the numbers of the form $2^m + 2$ with $m \geq 0$.