[Math] What’s the remainder when this huge number is divided by 45

number theory

One of my friends recently gave a mock test of a math exam in which he was asked this horrific question. He asked the same to me and I was totally blank on looking at it. So, it will be a huge help if any of you can solve this.
Here is the question:

A 79 digit long number is made by writing the natural numbers from 1 to 44 in order like 1234567891011121314…..424344. What is the remainder when this number is divided by 45?

Thanks in advance!
Enjoy Solving!

Best Answer

Hint: I'd use the Chinese remainder theorem, which says that the mapping $${\Bbb Z}_{45} \rightarrow {\Bbb Z}_5\times {\Bbb Z}_9: x\mapsto (x\mod 5, x\mod 9)$$ is a ring isomorphism.

Thus you can separately divide the large number by 5 and by 9. These remainders can then be combined to obtained the remainder modulo 45.

Modulo 5 the situation is simple, just look at the last digit of the number.

Modulo 9, observe that $10 \equiv 1 \mod 9$ and so $10^n\equiv 1 \mod 9$ for each $n\geq 1$. So modulo 9 you just look for the ''Quersumme'' (cross sum).

So you have to find a number $x$ between 0 and 44 such that $x$ is congruent 4 modulo 5 and congruent $Q$ modulo 9, where $Q$ is the cross sum of your number.

This number is congruent 4 mod 5 and so is one of the following: 4, 9, 14, 19, 24, 29, 34, 39, 44.

Related Question