Check if n is even then every set will contain 2 adjacent elements up - to n
if ( n % 2 == 0 ) { for ( let i = 0 ; i < Math . floor ( n / 2 ) ; i ++ ) { firstadj = 2 * i + 1 ; secadj = 2 * i + 2 ; document . write ( " " + firstadj + " " + secadj + " " + " " ) ; } } else {