0

The expression is: 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?

4

2 回答 2

1

不可能得到这个值。实际上,给定的m和有多种可能性x。例如,采取n mod 3 = 1. 我们知道它m是 3 并且x是 1,但仅仅知道它,我们不知道n是 4 还是 7 还是 10 还是 13 或任何其他比三的倍数大一的数字。

于 2013-10-20T22:10:09.673 回答
0

我不认为这是可以做到的——看几个例子

10 mod 9 = 1

19 mod 9 = 1

n 可以是 10、19、28 等...或

9 mod 8 = 1

17 mod 8 = 1

n 可以是 9、17、25 等...

于 2013-10-20T22:13:30.407 回答