Driver code
let N = 131 ; document . write ( longest_gap ( N ) + " " ) ; N = 8 ; document . write ( longest_gap ( N ) + " " ) ; N = 17 ; document . write ( longest_gap ( N ) + " " ) ; N = 33 ; document . write ( longest_gap ( N ) + " " ) ;