If the numerator and denominator are coprime
if ( __gcd ( i , j ) == 1 ) { let a = ` ${ i } ` ; let b = ` ${ j } ` ; document . write ( ` ${ a } ${ b } ` ) } } } } const __gcd = ( a , b ) => { if ( b == 0 ) { return a ; } else { return __gcd ( b , a % b ) ; } }