The rational number 49/33 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/33 = (49-0)/33 = {

( 49, 0, 33 ),

( 98, 0, 66 ), ( 98, 49, 33 ),

( 147, 0, 99 ), ( 147, 49, 66 ), ( 147, 98, 33 ),

( 196, 0, 132 ), ( 196, 49, 99 ), ( 196, 98, 66 ), ( 196, 147, 33 ),

( 245, 0, 165 ), ( 245, 49, 132 ), ( 245, 98, 99 ), ( 245, 147, 66 ), ( 245, 196, 33 ),

( 294, 0, 198 ), ( 294, 49, 165 ), ( 294, 98, 132 ), ( 294, 147, 99 ), ( 294, 196, 66 ), ( 294, 245, 33 ),

( 343, 0, 231 ), ( 343, 49, 198 ), ( 343, 98, 165 ), ( 343, 147, 132 ), ( 343, 196, 99 ), ( 343, 245, 66 ), ( 343, 294, 33 ),

( 392, 0, 264 ), ( 392, 49, 231 ), ( 392, 98, 198 ), ( 392, 147, 165 ), ( 392, 196, 132 ), ( 392, 245, 99 ), ( 392, 294, 66 ), ( 392, 343, 33 ),

( 441, 0, 297 ), ( 441, 49, 264 ), ( 441, 98, 231 ), ( 441, 147, 198 ), ( 441, 196, 165 ), ( 441, 245, 132 ), ( 441, 294, 99 ), ( 441, 343, 66 ), ( 441, 392, 33 ),

( 490, 0, 330 ), ( 490, 49, 297 ), ( 490, 98, 264 ), ( 490, 147, 231 ), ( 490, 196, 198 ), ( 490, 245, 165 ), ( 490, 294, 132 ), ( 490, 343, 99 ), ( 490, 392, 66 ), ( 490, 441, 33 ),

( 539, 0, 363 ), ( 539, 49, 330 ), ( 539, 98, 297 ), ( 539, 147, 264 ), ( 539, 196, 231 ), ( 539, 245, 198 ), ( 539, 294, 165 ), ( 539, 343, 132 ), ( 539, 392, 99 ), ( 539, 441, 66 ), ( 539, 490, 33 ),

( 588, 0, 396 ), ( 588, 49, 363 ), ( 588, 98, 330 ), ( 588, 147, 297 ), ( 588, 196, 264 ), ( 588, 245, 231 ), ( 588, 294, 198 ), ( 588, 343, 165 ), ( 588, 392, 132 ), ( 588, 441, 99 ), ( 588, 490, 66 ), ( 588, 539, 33 ),

( 637, 0, 429 ), ( 637, 49, 396 ), ( 637, 98, 363 ), ( 637, 147, 330 ), ( 637, 196, 297 ), ( 637, 245, 264 ), ( 637, 294, 231 ), ( 637, 343, 198 ), ( 637, 392, 165 ), ( 637, 441, 132 ), ( 637, 490, 99 ), ( 637, 539, 66 ), ( 637, 588, 33 ),

( 686, 0, 462 ), ( 686, 49, 429 ), ( 686, 98, 396 ), ( 686, 147, 363 ), ( 686, 196, 330 ), ( 686, 245, 297 ), ( 686, 294, 264 ), ( 686, 343, 231 ), ( 686, 392, 198 ), ( 686, 441, 165 ), ( 686, 490, 132 ), ( 686, 539, 99 ), ( 686, 588, 66 ), ( 686, 637, 33 ),

...

}

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)