Consider the positive integer

$$
n=2^{r}-16^{s}
$$

where $r$ and $s$ are also positive integers. Find the conditions that $r$ and $s$ must satisfy for the remainder of the division of $n$ by 7 to be 5. Find the smallest number that satisfies this condition.

## Solution.
The remainders obtained by dividing the powers of 2 by 7 are $\{1,2,4,1,2,4, \ldots\}$, repeating with a period of 3. These same remainders are obtained by dividing 16 by 7. Therefore, the only possibility to get a remainder of 5 when subtracting is that

$$
r=\dot{3}+1 \quad \text { and } \quad s=\dot{3}+2
$$

These are the required conditions.

To find the minimum positive $n$ we write

$$
n=2^{3 k+1}-16^{3 h+2}=2^{3 k+1}-2^{12 h+8}
$$

It should be $2 k+1>12 h+8$ (the function $2^{x}$ is increasing) equivalent to $2 k-12 h-7>0$. The minimum will be obtained when $2 k-12 h-7$ is minimum (the function $2^{x}$ is convex), and it is easily seen that this minimum is obtained for $k=3$ and $h=0$ and results in

$$
n=2^{10}-2^{8}=768
$$

D3.-