[Math] Proving Decimal Representation

arithmeticlogic

Prove that if the decimal representation of a nonnegative integer n ends in $5$ or $0$ then $5 | n$. (Hint: As
a first step show that if the decimal representation of a nonnegative n integer ends in $d0$ then there is an
integer $s4$ such that $n = 10s + d0$).

To solve this I assumed that if $n$ ends in $5$, $n=10m+5$ and $10=5\cdot{2}$.

Thus, $n=5(2m+1)$. and therefore it is divisible by $5$.

Firstly, is my work correct, and if it is, is there any way to improve it? Also, can somebody explain more in plain English what I did, I knew how to solve the problem because I knew the theorem but can anybody actually explain why is that $n=10m+5$ or $n=10s + d0$?

Best Answer

You did well enough, but to improve it, don't assume the number ends in 5.

Simply show that for $10s+d$ to be divisible by $5$ requires $d$ to be either 0 or 5.


  • By definition of decimal representation, if a non-negative integer $n$ ends in decimal-digit $d$, then there exists some non-negative integer $s$ such that $n = 10\cdot s + d$.

    • Now, since $10\cdot s = 2\cdot 5\cdot s$, then $10\cdot s$ is divisible by $5$ for all $s$.

    • So $n$ will be divisible by $5$ if and only if $d$ is divisible by $5$, (Why?)

    • The only decimal-digits divisible by $5$ are 0 and 5.

  • Therefore a non-negative integer ending in decimal digit is divisible by $5$ if and only if the decimal representation ends with either digit 0 or 5.

  • That is $\forall n\in \Bbb N^* :\Big[(n \mid 5) \iff \exists s\in \Bbb N^* :\big((n=10s + d) \wedge (d=0 \vee d=5)\big)\Big]$

Related Question