Loop to print the Fractions
for ( var i = 0 ; i < n ; i ++ ) { if ( ar [ i ] % n === 0 ) { document . write ( " " + ar [ i ] / n + " " ) ; } else { document . write ( n + " " + ar [ i ] + " " ) ; } } }