to check for twin prime numbers display th twin prime
for ( let i = 2 ; i <= n - 2 ; i ++ ) { if ( prime [ i ] == true && prime [ i + 2 ] == true ) document . write ( " " + i + " " + ( i + 2 ) + " " ) ; } }