Here's a way to construct a list containing every positive rational number:
Build a binary tree where each node is a rational and the root is `1/1`, with the following rules for creating the nodes below:
* The value of the left-hand node below `a/b` is `a/a+b`
* The value of the right-hand node below `a/b` is `a+b/b`
So the tree will look like this:
```
                       1/1
                  /           \ 
            1/2                  2/1
           /    \              /     \
       1/3        3/2        2/3       3/1
      /   \      /   \      /   \     /   \
   1/4    4/3  3/5   5/2  2/5   5/3  3/4   4/1
 ...
```
Now traverse the tree, breadth first, to get a list of rationals.
```
[ 1/1, 1/2, 2/1, 1/3, 3/2, 2/3, 3/1, 1/4, 4/3, 3/5, 5/2, .. ]
```
Every positive rational will occur, in its reduced form, exactly once in the list, at a finite index.
```if:haskell
In the kata, we will use tuples of type `(Integer, Integer)` to represent rationals, where `(a, b)` represents `a / b`
```
```if:javascript
In the kata, we will use tuples of type `[ Number, Number ]` to represent rationals, where `[a,b]` represents `a / b`
```
Using this method you could create an infinite list of tuples:
matching the list described above:
However, constructing the actual list is too slow for our purposes. Instead, study the tree above, and write two functions:
For example:
# This is not my code :,(
# I used those functions from here http://240hoursoflearning.blogspot.com/2017/09/the-calkin-wilf-tree.html
# Shame and dishonor on me :,( 

def rat_at(n):
    # This is not my code :,(
    frac = [0, 1]
    n += 1
    nums = [n]

    while n > 0:
        n = n//2
        nums.append(n)

    for n in reversed(nums):    
        if n%2!=0:
            frac[0] += frac[1]

        else:
            frac[1] += frac[0]
    
    return tuple(frac)



def index_of(a, b):
    # This is not my code :,(
    if [a, b] == [1, 1]:
        return 0

    path = ''

    while [a, b] != [1, 1]:
        if a < b:
            b -= a
            path += '0'
        else:
            a -= b
            path += '1'
    addForDepth = 2**len(path)-1

    return addForDepth + int(path[::-1], 2)



# This is not my code :,(
# I used those functions from here http://240hoursoflearning.blogspot.com/2017/09/the-calkin-wilf-tree.html
# Shame and dishonor on me :,( 

def rat_at(n):
    # This is not my code :,(
    frac = [0, 1]
    n += 1
    nums = [n]

    while n > 0:
        n = n//2
        nums.append(n)

    for n in reversed(nums):    
        if n%2!=0:
            frac[0] += frac[1]

        else:
            frac[1] += frac[0]
    
    return tuple(frac)



def index_of(a, b):
    # This is not my code :,(
    if [a, b] == [1, 1]:
        return 0

    path = ''

    while [a, b] != [1, 1]:
        if a < b:
            b -= a
            path += '0'
        else:
            a -= b
            path += '1'
    addForDepth = 2**len(path)-1

    return addForDepth + int(path[::-1], 2)


