# Proof: divisibility of 5

1. Nov 14, 2007

### Prathep

I need some help proving this statement.

Prove that a positive integer is divisible by 5 if and only if it's last digit is either
0 or 5.

Thanks

2. Nov 14, 2007

### Prathep

I need some help proving this statement.

1. The problem statement, all variables and given/known data

Prove that a positive integer is divisible by 5 if and only if it's last digit is either
0 or 5.

2. Relevant equations

3. The attempt at a solution

3. Nov 14, 2007

### CompuChip

One way is easy. Suppose n is a positive integer that ends in 0 or 5. Then we can write
$$n = 10k + 5\epsilon$$
with k a positive integer and $\epsilon$ = 0 or 1. For example,
1234985135 = 123498513 * 10 + 5. Then obviously $n / 5 = k + \epsilon$ which is a positive integer again.

Also this approach should give you a clue for the other direction (suppose n is divisible by 5, then you can write it as 5k for some positive integer k. Now what can you say about k?)

4. Nov 14, 2007

### CompuChip

Let's continue the conversation here, so we don't have to double post as well.

5. Nov 15, 2007

### HallsofIvy

Better yet, I've merged the two threads- into this one since the problem doesn't seem to me to have a lot to do with "Computer Science and Technology"!

6. Dec 17, 2007

### al-mahed

every integer in the decimal system can be written as follows:

$$z = a_0 + a_1*10 + a_2*10^2 + ... + a_n*10^n$$

as 10 is the product of 2 and 5 ==> 5 | 10

for n > 0 all terms have 0 as the last digit

if z is a number with last digit = 0, then $$a_0 = 0$$ ==> 5 | z

else $$a_0 = 5$$ and also this implies 5 | z