New Sol

# New Prob
## in conclusion:
### $n+m-(n,m)$
## prof
Let's build a diagram that is the case, each point $ i \ rightarrow i + n, i \ rightarrow im $ Of course, these numbers must be within range.
Then the problem is clear, the problem is transformed into a new survival ring does not exist. If there is a ring, it will not be possible (which means that the period of the number of both positive or negative). If there is no ring, it must be (from a starting position either configuration).
First, there is an upper bound, $ n + m-2 $. The upper bound proved very good and very classic. But because it is interesting here to mention two. We consider a matrix of $ i $ $ a_i, a_ {i + 1}, ..., a_ {i + b-1} $, $ a total of $ n-rows, such as rows and n columns, and as negative, and positive and negative matrix and contradictions.
We start with simple problems, we consider only $ (a, b) = 1 $ is the case, we assume that there is a ring, the ring is the end to end in accordance with one of the basic properties. Then there must be $ nx + my = 0 $. Consider this formula, according to Pei Shu theorem, the upper ring $ \ exists x, x \ equiv m-1 \ (mod \ m) $, we consider this point, and only the condition m $ point in the range of -1 $. So this point there must be inevitable next step, but this is impossible. So contradiction, will not ring.
For $ (n, m) \ neq1 $ difference is only $ \ exists x, x \ equiv m- (n, m) \ (mod \ m) $, leaving the reader to testify.

Guess you like

Origin www.cnblogs.com/Beholer-Jack/p/12381286.html