\section*{Exercise 5 - 041015}

The number \(2^{3217}-1\) has been identified as a prime number.

a) Determine how many digits this number has!

b) What is the last digit of this number?
}

Let \(\lg x\) be the logarithm of \(x\) to the base 10, \([x]\) the floor function, which gives the greatest integer \(\leq x\), and \(y \bmod x (x, y \in \mathbb{Z})\) the integer remainder when \(y\) is divided by \(x\).

(a) Rewriting the number \(2^{3217}\) in base 10 yields:

\[
2^{3217}=10^{\lg \left(2^{3217}\right)}=10^{3217 \cdot \lg 2}
\]

Since \(10^{n}\) is the smallest \((n+1)\)-digit number in the decimal system, for a positive real number \(r\), the number of digits of \(10^{r}\) is \([r]+1\). The number of digits of \(2^{3217}\) is thus

\[
[3217 \cdot \lg 2]+1=969
\]

Since \(2^{3217}\) does not contain the factor 5, \(2^{3217}\) cannot be of the form \(10^{n}\). In particular, \(2^{3217}\) is not the smallest 969-digit number, and consequently, \(2^{3217} - 1\) also has 969 decimal digits.

(b) It suffices to consider the last digit, so all calculations can be performed modulo 10. We have:

\[
\begin{aligned}
& 2^{1} \quad \bmod 10=2 \quad ; \quad 2^{2} \quad \bmod 10=4 \quad ; \quad 2^{3} \quad \bmod 10=8 \\
& 2^{4} \quad \bmod 10=6 \quad ; \quad 2^{5} \quad \bmod 10=2
\end{aligned}
\]

Thus, we are dealing with a 4-cycle. Let \(n \in \mathbb{N}\) and \(2^{n}\) be given. If \(n \bmod 4=1\), \(2^{n}\) ends in 2; if \(n \bmod 4=2\), it ends in 4; if \(n \bmod 4=3\), it ends in 8; and if \(n \bmod 4=0\), it ends in 6. No other possibilities exist.

Since \(3217 \bmod 4=1\), \(2^{3217}\) ends in 2, and \(2^{3217}-1\) consequently ends in 1.

The information that \(2^{3217}-1\) is a prime number was not needed for solving the problem.