When you decompose the long division of 5 by 4, the first step is that 5= 1*4+1

then you multiply the leftover, here 1, by 10 to get the next decimal number and you start again: 1*10=10=2*4+2

here the leftover (here 2), it isn't 0 or the same as before (it's not 1 again) so you carry on the procedure by multiplying the leftover by 10 and dividing the result by 4: 2*10=20=5*4+0

This time the leftover is zero therefore you stop and you actually find 1.25, which is also 125/100.... Even though 1.25 isn't an integer, what matter is that at each step we took the leftover of each division was one, and it's at the end that we wrote the result into its decimal form (aka 1.25)

Now for m/n, we have been ask to prove that the result is "

*either zero repetend or repeating decimal*", nothing more. We don't care to know how many decimal there is if it's repetend or how many decimal there are if repeating. For this we need to focus on the property of the leftover, and as you said above:

lets do the step one m=q

_{1}*n+r

_{1}
so r

_{1} can only be equal to only one of those integers: 0; 1; 2; 3; .....; n-2; n-1, note that there is only (n-1) possible value that isn't 0 (earlier, in 5/4 leftover could only have the value 0; 1; 2; 3)

Now if r

_{1}=0 then we're done, if not we have to divide r

_{1} by n for step2

r

_{1}=q

_{2}*n+r

_{2}
Now if r

_{2}=0 we are done, if r

_{2}=r

_{1} then we have entered a cycle. Else we have to divide r

_{2 }by n again for step3

r

_{2}=q

_{3}*n+r

_{3}
if r

_{3}=0 we are done, if r

_{3} equals r

_{1} or r

_{2} we have entered a cycle and are done, else I'll divide r

_{3} by n for step4

and so on and so forth

What matter here is that since there is a limited number of possible value for the leftover, I'm bound either to finally get 0 or any leftover I've already found previously. 0≤ r <n with r and n being integer are the key to prove that m/n is either zero repetend or repeating decimal (technically we proved it can't be another way)

.

for 254178 / 7855

any leftover of any step could only have the value 0; 1; 2; 3;.....; 78853; 78854.

so if after 78854 steps I haven't found a leftover that is 0 or one that I have already found, then I will at step 78855 because there isn't any other option left.

because if the numbers are the same, so will the result of their division

, what matter here is the value of r

_{i}, the value of q

_{i} is irrelevent.

because 0=<r<n, r and n being integers, it's easy to count how many number there are between 1 and n-1