2

I am devising an algorithm to solve equations like the following:

$$10^{\lfloor\log(p1)\rfloor}x+p_1\equiv0\pmod{p_2}$$

In the scenario: $10^{1}x+5\equiv0\pmod{7}$, where $p_1=5$ and $p_2=7$, Wolfram Alpha prints out that the integer solution is $x=7N+3$, where $N\in\mathbb{Z}$.

In my case, I cannot figure out how to mathematically find that solution for $x$.

Clearly $7N$ makes sense because the divisor is $7$.

But do I arrive at $+3$ if I'm only given variables $p_1=5$ and $p_2=7$?

Please note the solutions in the following cases:

  • $ 10x+ 7\equiv0\pmod{11} \implies x=11N+ 7$
  • $100x+11\equiv0\pmod{13} \implies x=13N+ 6$
  • $100x+13\equiv0\pmod{17} \implies x=17N+15$
  • $100x+17\equiv0\pmod{19} \implies x=19N+ 8$
  • $100x+19\equiv0\pmod{23} \implies x=23N+12$

Again, my question is, how do I get those last numbers ($7,6,15,8,12$) by using algebra instead of trying different values until the equations fits?

barak manos
  • 43,109
Riddler
  • 21

0 Answers0