Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
The expression is: n mod m = x
n mod m = x
I want to know the value of n given m and x Is possible to get this value ? Is there is a java function to get that number?
n
m
x
不可能得到这个值。实际上,给定的m和有多种可能性x。例如,采取n mod 3 = 1. 我们知道它m是 3 并且x是 1,但仅仅知道它,我们不知道n是 4 还是 7 还是 10 还是 13 或任何其他比三的倍数大一的数字。
n mod 3 = 1
我不认为这是可以做到的——看几个例子
10 mod 9 = 1 19 mod 9 = 1
n 可以是 10、19、28 等...或
9 mod 8 = 1 17 mod 8 = 1
n 可以是 9、17、25 等...