I thought of a puzzle where a function outputs a concatenated number, depending on the input. If the input is 1, then the output is 1111...111111, where there are 2018 1's put together to form a number. The stipulation is that the greatest value in the function's domain is 2018 (to fit with the 2018 theme!). The question is, what values of inputs in the range 1-2018 inclusive, outputs a number divisible by 11? I started this question with considering the alternating sum rule of the divisibility test for 11. I found that 1-9 work, 11, 22, 33, 44, 55, 66, 77, 88, and 99 work, as well as other numbers with identical digits in their representation. However, I don't know what other numbers are successes, and what the exact number of successful values is. Is there any more ways to proceed? What other approaches are viable, and does anyone know of a slick or intuitive solution to this? Is there a generalization to this problem that can be considered to extend this problem/puzzle? Thank you in advance!
A Peculiar Function
150 Views Asked by user462820 https://math.techqa.club/user/user462820/detail AtThere are 4 best solutions below
On
Let the input be $k$, and let $l$ be the number of digits in $k$. We have that
$$f(k) = k\cdot (10\cdots010\cdots010\cdots\cdots\cdots010\cdots01)$$
where there are $2018$ ones and $l-1$ zeroes between each pair of ones. Since $11$ is prime, $11|f(k)$ iff $11|k$ or
$$11|(10\cdots010\cdots010\cdots\cdots\cdots010\cdots01)$$
We can use the divisibility test for $11$s now. If $l$ is odd, the sum of the digits in even positions is $1009$, the same sum of digits in odd positions. Thus $11$ divides it. However, if $l$ is even, the sum of the digits in odd positions is $0$, while in even positions it is all $2018$. Since $11\nmid 2018$, this means that $11$ does not divide $f(k)$.
In summary, $11$ divides $f(k)$ iff $11|k$ or the number of digits in $k$ is odd.
An interesting note is that in $2024$, $11$ will always divide $k$ concatenated $2024$ times.
On
For a one digit number $P$ we get \begin{eqnarray*} \underbrace{PP \cdots P}_{2018 \text{times}} =P \sum_{k=0}^{2017} 10^k =P \frac{10^{2018}-1}{10-1} \\ \end{eqnarray*} Note that $x^{2018}-1= (x^2-1)(x^{2016}+x^{2014}+ \cdots + x^2+1)$ & the first factor is $9 \times 11$. So \begin{eqnarray*} \underbrace{PP \cdots P}_{2018 \text{times}} =11 N (10^{2016}+10^{2014}+ \cdots + 10^2+1) \\ \end{eqnarray*} So as you observe in the question any one digit number will generate a value that is divisible by $11$.
For a two digit number $PQ$ we get \begin{eqnarray*} \underbrace{PQPQ \cdots PQ}_{2018 \text{times}} =PQ \sum_{k=0}^{2017}100^k =PQ \frac{100^{2018}-1}{100-1} \\ \end{eqnarray*} Note that $x^{2018}-1= (x^2-1)(x^{2016}+x^{2014}+ \cdots + x^2+1)$ & the first factor is $99 \times 101$. So \begin{eqnarray*} \underbrace{PQPQ \cdots PQ}_{2018 \text{times}} =101 N (100^{2016}+100^{2014}+ \cdots + 100^2+1) \\ \end{eqnarray*} So the only two digit number will generate a value that is divisible by $11$ are where PQ is itself divisible by $11$. So $11,22, \cdots ,99$.
For a three digit number $PQR$ we get \begin{eqnarray*} \underbrace{PQRPQR \cdots PQR}_{2018 \text{times}} =P \sum_{k=0}^{2017} 1000^k =PQR \frac{1000^{2018}-1}{1000-1} \\ \end{eqnarray*} Note that $x^{2018}-1= (x^2-1)(x^{2016}+x^{2014}+ \cdots + x^2+1)$ & the first factor is $999 \times 1001$. Now $1001$ can be factorised ... $1001=7 \times 11 \times 13$ \begin{eqnarray*} \underbrace{PQRPQR \cdots PQR}_{2018 \text{times}} =11 \times 7 \times 13 PQR (1000^{2016}+1000^{2014}+ \cdots + 1000^2+1) \\ \end{eqnarray*} So any three digit number will generate a value that is divisible by $11$.
For a four digit number $PQRS$ we get \begin{eqnarray*} \underbrace{PQRSPQRS \cdots PQRS}_{2018 \text{times}} =PQRS \sum_{k=0}^{2017}10000^k =PQRS \frac{10000^{2018}-1}{10000-1} \\ \end{eqnarray*} Note that $x^{2018}-1= (x^2-1)(x^{2016}+x^{2014}+ \cdots + x^2+1)$ & the first factor is $9999 \times 10001$. Observe that $10001=73 \times 137 $ \begin{eqnarray*} \underbrace{PQRSPQRS \cdots PQRS}_{2018 \text{times}} =73 \times 137 PQRS (100^{2016}+100^{2014}+ \cdots + 100^2+1) \\ \end{eqnarray*} So the only four digit number will generate a value that is divisible by $11$ are where PQRS is itself divisible by $11$.
On
Numbers are divisible by $11$ if and only if the sum of the odd digits minus the sum of the even digits are divisible by $11$.
If $n$ has an even number of digits then $f(n) = (ab....m)....$. The sum of the even digits are $2018(a+c+....+l)$ and the sum of the odd digits are $2018(b+c +...+ m)$ and the difference is $2018(a+c+...+l - b-d-....m)$. As $11$ is prime and does not divide $2018$, then $11|f(n) \iff 11|(a+c+...+l - b-d-....m)\iff 11|n$.
If $n$ has an odd number of digits then $f(n) = (ab...kab....k)....$ written out $1009$ times. The sum of the even digits are $1009(a+c+....+k+b+d+.....+j)$ and the sum of the odd digits are $1009(b+d+....+j+a+c + ....+k)$. Then difference is $0$ so $11|f(n)$.
Conclusion:
$f(n)$ is divisible if and only if: either $n$ has an odd number of digits, or $11|n$
The alternating sum rule for divisibility by 11 means that if the number's digits can be divided into repeating blocks with an even number of digits, then divisibility by 11 requires either the number of blocks to be divisible by 11 or that the block itself is divisible by 11. Since 2018 isn't divisible by 11, we'll need the blocks to be divisible by 11. If $n$ has an even number of digits, then $n$ itself is the repeating block, and $11|f(n)$ if and only if $11|n$. If $n$ has an odd number of digits, $11|f(n)$ if and only if $11|nn$, where $nn$ is a concatenation of two copies of $n$.
However, if $d$ is the number of digits in $n$ and is odd, then $nn = (10^{d} + 1)n = (10+1)\left|\sum_{i=0}^{d-1}(-10)^{i}\right|n$, so clearly $11|nn$. Thus we have