The rational number 49/19 as a set

One way to define a rational number (a-b)/c is to define it as the (infinite) set of all 3-tuples of natural numbers (a1, b1, c1) for which (a-b)/c = (a1-b1)/c1 (b is needed for negative numbers).

Klick on a 3-tuple to see how it may be defined as a set.

49/19 = (49-0)/19 = {

( 49, 0, 19 ),

( 98, 0, 38 ), ( 98, 49, 19 ),

( 147, 0, 57 ), ( 147, 49, 38 ), ( 147, 98, 19 ),

( 196, 0, 76 ), ( 196, 49, 57 ), ( 196, 98, 38 ), ( 196, 147, 19 ),

( 245, 0, 95 ), ( 245, 49, 76 ), ( 245, 98, 57 ), ( 245, 147, 38 ), ( 245, 196, 19 ),

( 294, 0, 114 ), ( 294, 49, 95 ), ( 294, 98, 76 ), ( 294, 147, 57 ), ( 294, 196, 38 ), ( 294, 245, 19 ),

( 343, 0, 133 ), ( 343, 49, 114 ), ( 343, 98, 95 ), ( 343, 147, 76 ), ( 343, 196, 57 ), ( 343, 245, 38 ), ( 343, 294, 19 ),

( 392, 0, 152 ), ( 392, 49, 133 ), ( 392, 98, 114 ), ( 392, 147, 95 ), ( 392, 196, 76 ), ( 392, 245, 57 ), ( 392, 294, 38 ), ( 392, 343, 19 ),

( 441, 0, 171 ), ( 441, 49, 152 ), ( 441, 98, 133 ), ( 441, 147, 114 ), ( 441, 196, 95 ), ( 441, 245, 76 ), ( 441, 294, 57 ), ( 441, 343, 38 ), ( 441, 392, 19 ),

( 490, 0, 190 ), ( 490, 49, 171 ), ( 490, 98, 152 ), ( 490, 147, 133 ), ( 490, 196, 114 ), ( 490, 245, 95 ), ( 490, 294, 76 ), ( 490, 343, 57 ), ( 490, 392, 38 ), ( 490, 441, 19 ),

( 539, 0, 209 ), ( 539, 49, 190 ), ( 539, 98, 171 ), ( 539, 147, 152 ), ( 539, 196, 133 ), ( 539, 245, 114 ), ( 539, 294, 95 ), ( 539, 343, 76 ), ( 539, 392, 57 ), ( 539, 441, 38 ), ( 539, 490, 19 ),

( 588, 0, 228 ), ( 588, 49, 209 ), ( 588, 98, 190 ), ( 588, 147, 171 ), ( 588, 196, 152 ), ( 588, 245, 133 ), ( 588, 294, 114 ), ( 588, 343, 95 ), ( 588, 392, 76 ), ( 588, 441, 57 ), ( 588, 490, 38 ), ( 588, 539, 19 ),

( 637, 0, 247 ), ( 637, 49, 228 ), ( 637, 98, 209 ), ( 637, 147, 190 ), ( 637, 196, 171 ), ( 637, 245, 152 ), ( 637, 294, 133 ), ( 637, 343, 114 ), ( 637, 392, 95 ), ( 637, 441, 76 ), ( 637, 490, 57 ), ( 637, 539, 38 ), ( 637, 588, 19 ),

( 686, 0, 266 ), ( 686, 49, 247 ), ( 686, 98, 228 ), ( 686, 147, 209 ), ( 686, 196, 190 ), ( 686, 245, 171 ), ( 686, 294, 152 ), ( 686, 343, 133 ), ( 686, 392, 114 ), ( 686, 441, 95 ), ( 686, 490, 76 ), ( 686, 539, 57 ), ( 686, 588, 38 ), ( 686, 637, 19 ),

...

}

The equation (a-b)/c = (a1-b1)/c1 is equivalent to a·c1 + b1·c = a1·c + b·c1 - so only addition and multiplication of natural numbers are needed to define the rational numbers.

For rational numbers Q, Q1 as defined above, Q < Q1 is defined as a·c1 + b1·c < a1·c + b·c1 for one/all (a, b, c) ∈ Q, (a1, b1, c1) ∈ Q1.

Q + Q1 is defined as (a2-b2)/c2, where a2 = a·c1 + a1·c, b2 = b·c1 + b1·c, c2 = c·c1 for one/all (a, b, c) ∈ Q, (a1, b1, c1) ∈ Q1.

Be aware that (a2-b2)/c2 is simply a notation for the set determined by a2, b2 and c2 here - not an expression using subtraction and division.

The definition for Q + Q1 above simply is a transformation of the expression (a-b)/c + (a1-b1)/c1.

Assuming that a,c is minimal for a positive rational number a/c or (a-0)/c, we can enumerate all members of the set by doing this:

Let n be 1
Repeat:
  For all n1 from 0 to n-1:
    Let a1 be n·a
    Let b1 be n1·a
    Let c1 be (n-n1)·c
    Enumerate (a1,b1,c1)
  Increase n by 1

The enumeration as Python function with a limiting parameter k which will cause the function to enumerate (k·(k+1))/2 elements of a/c:

def print_rational_number(a,c,k):
    print str(a)+'/'+str(c)+' = ('+str(a)+'-0)/'+str(c)+' = {'
    for n in range(1,k+1):
        for n1 in range(n):
            a1=n*a
            b1=n1*a
            c1=(n-n1)*c
            print '( '+str(a1)+', '+str(b1)+', '+str(c1)+' ),'
        print
    print "..."
    print "}"

(back to √2)