How do I solve this equation
$L = D + [D:4]$
- $L$ is a known integer obtained previously;
- $D$ is an integer;
- $[D:4]$ is the quotient part of ($D/4$.)
At first glance, I did not know how to solve this equation as I have never seen this type in my calculus studies. After searching online I found that this is modular arithmetic for two reasons:
- The original relation is a congruence equation (Zeller's Rule) dealing with cyclical calendar numbers and I understand that modular arithmetic deals with cyclical integers.
$D/4=quotient(D/4)+remainder (D/4)$ and since $D \pmod 4=remainder(D /4)$ that also means we are dealing with modular arithmetic.
$∴ [D:4]=D/4-D \pmod 4$
$∴ L=5/4 D-D \pmod 4 ……………….. (1)$
how to go further with eq. (1)?
Although I read the modular arithmetic rules and practiced a little but I wasn’t sure if I was going the right path. I tried to eliminate the $D \pmod 4$ part by multiplying it with its inverse according to the following rule:
Calculate $A \cdot D \pmod 4$ for $A$ values $0$ through $(4-1)$, the modular inverse of $\pmod 4$ is the $A$ value that makes $A \cdot D\equiv 1\pmod 4$ and only the numbers that share no prime factors with $4$ have a modular inverse $\pmod 4$
From this point, I can obtain an inverse (I think) but It makes no sense to me.
Can anyone help please.