1. Understanding the Problem:
- We are given a grid plane and need to consider all possible broken lines starting at (0,0), with vertices at integer points, and each segment either going up or to the right.
- For each broken line, we consider the corresponding "worm," which is the subset of the plane consisting of all cells that share at least one point with the broken line.
- We need to prove that the number of worms that can be divided into dominoes (rectangles 2×1 and 1×2) in exactly n>2 different ways is equal to the number of positive integers less than n and relatively prime to n.
2. Initial Observations:
- Each worm corresponds to a path from (0,0) to some point (a,b) on the grid.
- The problem can be approached by considering the tiling of the grid cells that the worm covers.
3. Recursive Approach:
- Suppose the last move of the broken line is rightward. If we tile the 2×2 square containing the last point with a horizontal domino, there is a unique way to tile the largest staircase of the skeleton such that the last vertex is in it.
- If we tile the 2×2 square containing the last vertex with a vertical domino, we can delete the last vertex and consider the remaining skeleton.
4. Recursion Formula:
- Let f(S) be the number of ways to tile any skeleton S with dominoes.
- We get the recursion:
f(S)=f(AS)+f(BS)
where AS is the remaining skeleton when we tile the last 2×2 square with a horizontal domino, and BS is the remaining skeleton when we tile it with a vertical domino.
5. Tree Representation:
- We can represent the recursion as a tree where each node corresponds to a skeleton S, and its children are AS and BS.
- In the k-th row of the tree, we have all the 2k paths of size k.
6. Labeling the Tree:
- For each skeleton S on the tree, label it with f(S).
- We want to prove that each integer n appears exactly φ(n) times on the tree, where φ(n) is the Euler's totient function.
7. Coprime Neighbors:
- From the recursion, two neighbors on the tree are coprime. This can be proved via induction.
8. Claim:
- For each vertex labeled with n, its parent is labeled with m∈(2n,n) and gcd(m,n)=1.
- Proof: Use induction. The base cases are done. The gcd condition is proved by the coprime neighbors property. Since n−m comes before m on the tree, n−m<m⟹2n<m.
9. Counting Appearances:
- For each m<n with gcd(m,n)=1, either m or n−m belongs to (2n,n). Thus, there are exactly 2φ(n) numbers belonging to (2n,n) which are coprime to n.
10. Uniqueness of Neighbors:
- There aren't two pairs of neighbors on the same side of the tree that are equal. This can be proved using induction.
11. Final Argument:
- Using the above claims and properties, we can prove that for each vertex v labeled with l, its parent is labeled with l0 such that gcd(l,l0)=1 and l0∈(2l,l), and its children are labeled with l1,l2 such that gcd(l,l1)=gcd(l,l2)=1 and l1,l2∈(l,2l).
- By induction, we can show that n appears φ(n) times on the tree.
The number of worms that can be divided into dominoes in exactly n different ways is φ(n).