Osalotioman's blog

By Osalotioman, history, 13 months ago, In English

Problem 2043B - Digits

My Solution 313195895

Idea for divisibility by 7

The standard divisibility rule seems to require a recursive approach based on my reasoning which led me to using Fermat's Little Theorem instead.

We have:

$$$\overbrace{ddddddd\ldots dddddd}^{n! \text{ terms}}$$$

which can be written as:

$$$d \cdot (\overbrace{1111111\ldots 111111}^{n! \text{ terms}})$$$

This simplifies to:

$$$ \frac{d}{9} \cdot (\overbrace{9999999\ldots 999999}^{n! \text{ terms}})$$$

Note:

$$$ 99 = 10^2 - 1 $$$
$$$ 999 = 10^3 - 1 $$$
$$$ \overbrace{9999999\ldots 999999}^{n \text{ terms}} = 10^n - 1$$$

Hence,

$$$ \frac{d}{9} \cdot (\overbrace{9999999\ldots 999999}^{n! \text{ terms}})$$$

can be written as:

$$$ \frac{d}{9} \cdot (10^{n!} - 1) $$$

Now, how does Fermat's Little Theorem come into play here?

According to Fermat's Little Theorem:

$$$ p \mid (a^{p-1} - 1) $$$

where $$$a \in \mathbb{Z}$$$, $$$p$$$ is prime and $$$\gcd(a, p) = 1$$$.

In this case, we want to check when the following holds:

$$$ 7 \mid (10^{n!} - 1) $$$

For this to hold, we need $$$n!$$$ to be a multiple of $$$p - 1$$$ i.e 6.

$$$2! = 2 \cdot 1$$$
$$$3! = \overbrace{3 \cdot 2 \cdot 1}^{3 \cdot 2 \cdot 1 = 6}$$$
$$$4! = 4 \cdot \overbrace{3 \cdot 2 \cdot 1}^{3 \cdot 2 \cdot 1 = 6}$$$
$$$n! = n \cdot (n-1) \ldots 4 \cdot \overbrace{3 \cdot 2 \cdot 1}^{3 \cdot 2 \cdot 1 = 6}$$$

Therefore $$$n!$$$ is a multiple of 6 when $$$n \gt 2$$$ as shown above.

Why n! must be a multiple of 6 for $$$ 7 \mid (10^{n!} - 1) $$$ to hold:

Assume $$$6 \mid n!$$$. Then we can write $$$n! = 6k$$$ where $$$k \in \mathbb{N}$$$

$$$7 \mid (10^{n!} - 1) \implies 7 \mid (10^{6k} - 1)$$$
$$$\implies 7 \mid ((10^k)^6 - 1)$$$
$$$\implies 7 \mid ((10^k)^{(7-1)} - 1)$$$

which holds from Fermat's Little Theorem.

Hence the condition necessary for

$$$\overbrace{ddddddd\ldots dddddd}^{n! \text{ terms}}$$$

to be a multiple of 7 i.e

$$$ 7 \mid \overbrace{ddddddd\ldots dddddd}^{n! \text{ terms}}$$$

is

$$$7 \mid d $$$ (The trivial case) Or $$$n \gt 2$$$.

Do you have an alternative approach?

  • Vote: I like it
  • +3
  • Vote: I do not like it