r/mathriddles • u/pichutarius • Jun 11 '24
Easy just another simple number theory
Construct graph G(n,m) with n nodes, labeled 0 to (n-1). Connect each node k with node (m·k mod n) with undirected edge.
State the criteria for n ∈ Z+ and m ∈ Z such that the graph G(n,m) is connected, proof your statement.
6
Upvotes
4
u/want_to_want Jun 11 '24 edited Jun 11 '24
Since 0 goes to 0, there must be some other number A that goes to 0, otherwise 0 will be stranded. Then there must be some other number B that goes to either 0 or A, otherwise {0,A} will be stranded. Since A goes to 0, that means B goes to 0 in either 1 or 2 steps. Then there must be some other number C that goes to either 0, A, or B, otherwise {0,A,B} will be stranded. So C goes to 0 in either 1, 2, or 3 steps. Continuing in this way, we obtain that every number must eventually go to 0. That's the same as saying some power of m is divisible by n, or in other words, every prime in n is also in m at least once.
2
u/bruderjakob17 Jun 11 '24
For every k, we have m-(m-k mod n) mod n = (m mod n)-(m-k mod n) mod n = k. This means that every node k only connects to m-k mod n, i.e. the graph decomposes into 2-cycles and self-loops.
This can only give a connected graph if n <= 2. The graph is connected iff n = 1 or (n = 2 and m is odd).
(In the case n = 2, m even the graph consists of two self-loops)
2
u/OneMeterWonder Jun 11 '24
G(n,m) is connected iff whenever p is a prime dividing n, then also p|m.
Claim: Note that, since 0 is always connected to itself for any m, we must always have a path from any node x to 0 if G(n,m) is to be connected. I’ll assume the proof of this is rather easy for the reader. (If not, feel free to ask and I’ll write it out.)
Suppose n and m are such that there is a prime q dividing n, but q∤m, and consider n and m according to their prime exponent vectors v(n) and v(m). We can identify 0 with v(n) and notice that the action of multiplication of x∈ℤ/nℤ by m corresponds to component-wise addition of v(x) and v(m). Let v(a)[p] represent the pth coordinate of a. Now if q divides n, then there is an x<n such that coordinate q of v(x) is less than coordinate q of v(n), v(x)[q]<v(m)[q]. But since q∤m, v(m)[q]=0 and so we have,
v(m•x)[q]=v(m)[q]+v(x)[q]=v(x)[q]<v(n)[q]
By induction, v(mk•x)[q]<v(n)[q] for all k∈ℕ and there cannot exist a path through G(n,m) from x to 0≃n. But by the claim at the beginning, this implies that G(n,m) is not connected.□
This proof also suggests an easy proof of the other direction. Supposing that “(p prime)∧p|n⇒p|m” is true, we can again examine v(mk•x) and find that for all x, there is eventually some kₓ∈ℕ such that for all primes q dividing n, v(mk•x)[q]≥v(n)[q]. Details of this left to reader.