0
$\begingroup$

Given two integers $a$ and $b$, determine if $a$ and $b$ are equivalent modulo any $k \, (k: 1 \lt k \lt |a - b|)$.

If $\exists$ an integer $ (k: 1 \lt k \lt |a - b|) \text{ and }a \equiv b \mod k$, then the algorithm would return true, otherwise it would return false.

I thought of this problem today.

Before attempting to solve it, I want to know if there is existing literature on the problem. However, I would need to know the problem to do research on it.

$\endgroup$
  • $\begingroup$ @miracle173 Could you please state clearly what your requirement is? And why do you need them? $\endgroup$ – fade2black Jul 24 '17 at 17:34
  • $\begingroup$ I have edited the question. $\endgroup$ – Tobi Alafin Jul 24 '17 at 21:33
  • $\begingroup$ The title you have chosen is not well suited to representing your question. Please take some time to improve it; we have collected some advice here. Thank you! $\endgroup$ – D.W. Jul 24 '17 at 22:10
0
$\begingroup$

You just need to check if $|a-b|$ is divisible by a some integer $k$. You can reduce it to the integer factorization problem if you are not interested in the trivial divisors 1 and $|a-b|$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.