Show bijection between natural and rational numbers
Analyze the show bijection between natural and rational numbers.
Examples
Input: "test_input_1"
Output: "output_1"
Input: "test_input_2"
Output: "output_2"
Hints
Consider how you can systematically list all rational numbers in a grid, then think about traversing this grid in a way that ensures every rational number is visited exactly once.
Explore the concept of "lowest terms" for rational numbers and how it might help in avoiding duplicates during the bijection construction.
Investigate the use of prime factorization to uniquely encode pairs of natural numbers into a single natural number, then extend this to map rationals to naturals while preserving uniqueness.
Show bijection between natural and rational numbers
Analyze the show bijection between natural and rational numbers.