The problems 1339-1344 were the tasks of the 6th International Mathematical Olympiad held in Moscow in July 1964.

a) What are all the positive integer values of \( n \) for which \( 2^n - 1 \) is divisible by 7?

b) Prove that \( 2^n + 1 \) is never divisible by 7, for any positive integer \( n \).
a) Substituting the first ten natural numbers for $n$, the value of $2^{n}-1$ is

$$
1, \quad 3, \quad 7, \quad 15, \quad 31, \quad 63, \quad 127, \quad 255, \quad 511, \quad 1023,
$$

and when these are divided by 7, they respectively give the following remainders:

$$
1, \quad 3, \quad 0, \quad 1, \quad 3, \quad 0, \quad 1, \quad 3, \quad 0, \quad 1 .
$$

Let's check whether this periodic repetition of remainders continues. If $n=3k$, where $k$ is a natural number, then

$$
2^{n}-1=2^{3k}-1=8^{k}-1^{k}=(8-1)A=7A
$$

and here $A$ is an integer because for any positive integer $k$, $a^{k}-b^{k}$ is divisible by $a-b$. For $n=3k+1$ and $n=3k+2$, we have

$$
\begin{aligned}
& 2^{3k+1}-1=2 \cdot 2^{3k}-1=2\left(2^{3k}-1\right)+1=2 \cdot 7B+1=7C+1 \\
& 2^{3k+2}-1=2^{2} \cdot 2^{3k}-1=4\left(2^{3k}-1\right)+3=4 \cdot 7D+3=7E+3
\end{aligned}
$$

where $B$ and $D$ are integers according to the first case, and thus $C$ and $E$ are also integers. This proves that for positive integer $n$, $2^{n}-1$ is divisible by 7 if and only if $n$ is divisible by 3.
b) $2^{n}+1=\left(2^{n}-1\right)+2$, so the remainder when divided by 7 is never 0, according to the previous results, since for $n=3k$ the remainder is $2$, for $n=3k+1$ it is $3$, and for $n=3k+2$ it is $5$.