<s>[INST] Remainder and long division I have been thinking about this. Lets say we take 7 divided by 3, we know the remainder is 1. However, if we let x=7 and x-4=3, and we take x/(x-4), after performing long division the remainder is 4. Why is it not 1?
 [/INST] Notice:
$7=4*3+(-5) $
$7=3*3+(-2) $
$7=2*3+1$
$7=1*3+4$
$7=0*3+7$
$7=-1*3+10$
Etc.  So which one qualifies as "the" remainder?  Why is it $1$?  Whis it not $4$, $10$ or $-2$?
Well, because the remainder is defined to be at least $0$ but strictly less than the divisor.
The 1 is "the" remainder.  The rest are congruences.  And there are an infinite number of them.
So $\frac x {x-4}= 1 + \frac 4 {x-4} $. Or in other words $x=1*(x-4)+4$.
But is $4$ "the" remainder?  Or is $4$ just a congruence?
The depends on whether $4 < x-4$ or not.  If $x=7$ then $4> x-4$ and $4$ is not "the" remainder.  It is a congruence.
In particular this is $7=1*3+4$.
... which is $7=1*3+3+1$ which is $7=(1+1)*3+1$ which is $7=2*3+1$
Note: we also have: $x = 2*(x-4)+(4-(x-4))=2*(x-4)+(8-x) $.
If we use that expression, then the remainder is $8-x$ which is $1$ for $x=7$.
</s>