# Problem of the Week Problem E and Solution Not Again

## Problem

When $$\frac{1}{50^{2023}}$$ is written as a decimal, it terminates.

What is the last non-zero digit in the decimal representation of $$\frac{1}{50^{2023}}$$?

## Solution

Our first instinct might be to use our calculator to get an idea of how the last digit behaves for the first few powers of $$\frac{1}{50}$$. This might work for a little while, however most calculators let us down too quickly.

Notice that $$\frac{1}{50^{2023}} = \left(\frac{1}{50}\right)^{2023}=\left(\frac{1}{100} \times 2\right)^{2023} = (0.01\times 2)^{2023} = (0.01)^{2023}\times 2^{2023}$$.

The last non-zero digit in the decimal representation of $$\frac{1}{50^{2023}}$$ will therefore be the last non-zero digit in the decimal representation of $$(0.01)^{2023}$$ multiplied by the last digit of $$2^{2023}$$.

Since the last non-zero digit in the decimal representation of $$(0.01)^{2023}$$ is $$1$$, the last non-zero digit in the decimal representation of $$\frac{1}{50^{2023}}$$ will therefore be the last digit of $$2^{2023}$$.

We now examine the last digit of various powers of $$2$$: \begin{align} 2^1=2 && 2^2=4 && 2^3=8 && 2^4=16\\ 2^5=32 && 2^6=64 && 2^7=128 && 2^8=256 \end{align} Notice that the last digit repeats every four powers of $$2$$. It is $$2$$, then $$4$$, then $$8$$, then $$6$$. This pattern continues, and we can verify that $$2^9$$ ends with a $$2$$, $$2^{10}$$ ends with a $$4$$, $$2^{11}$$ ends with an $$8$$, $$2^{12}$$ ends with a $$6$$, and so on. We will leave it up to the solver to explain why this pattern continues.

Now we need to determine the number of complete cycles of this pattern before we get to $$2^{2023}$$. Since $$\frac{2023}{4} = 505\frac{3}{4}$$, it follows that there are there are $$505$$ complete cycles. Since $$505\times 4 = 2020$$, this means $$2^{2020}$$ ends with a $$6$$, $$2^{2021}$$ ends with a $$2$$, $$2^{2022}$$ ends with a $$4$$, and $$2^{2023}$$ ends with an $$8$$.

Since $$2^{2023}$$ ends with an $$8$$, $$\frac{1}{50^{2023}}$$ also ends with an $$8$$.